Skip to content

Draft: Abstraction Layer File Scaffolder

Michelle Gill requested to merge feature/abstraction-layer-generator into master

What does this MR do and why?

In actually following the documentation step-by-step, a lot of what's documented can really be scaffolded. I was able to get a nearly working prototype running - I just couldn't figure out the frontend.

This scaffolding got as far as I was able to on the backend with a dummy prompt (testing with GraphQL).

Info

This is a Rails generator based on the existing usage metric generator - team!! 🙏

Run with

Replace TodoPlanningTest with your class name, eg: CoolFeature

Note:: The only provider supported right now is Vertex

rails generate gitlab:abstraction_layer:abstraction_layer TodoPlanningTest --provider vertex

Confirm working by

  1. Visit http://localhost:3000//-/graphql-explorer
  2. Tail the llm log in the gdk/gitlab directory tail -f log llm.log
  3. Run this:
mutation {
  aiAction(
    input: {
      todoPlanningTest: {
        resourceId: "gid://gitlab/User/1",
        userInput:"My input here"
      }, 
      clientSubscriptionId: "randomId"}
  ) {
    clientMutationId
  }
}

You should see new entries in the llm.log

Screen_Recording_2024-04-04_at_6.26.23_PM

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Michelle Gill

Merge request reports

Loading