Add LLM functionality using auto-model V2#2633
Conversation
453cc9a to
f3dbb92
Compare
f3dbb92 to
84de8ad
Compare
|
Any chance you could have a separate PR for the refactoring (first two commits)? It'd be easier for me personally but it would also probably bring feedback from others too since the query resolver/contextual queries isn't really an area we own/touched on a lot as a team. |
charisk
left a comment
There was a problem hiding this comment.
Thanks for getting this working and for writing a few tests too!
| import { join } from "path"; | ||
| import { assertNever } from "../common/helpers-pure"; | ||
|
|
||
| type Options = { |
There was a problem hiding this comment.
I don't quite get why we're calling things "Options" - to me they look like normal method inputs. Also it's hard to know the difference between Options and AutoModelQueryOptions
There was a problem hiding this comment.
These are regular method inputs, but with this many inputs it becomes somewhat harder to reason about the order of the arguments. By using an object, they are at least all named so it becomes easier to reason about them.
I've renamed it to AutoModelQueriesOptions and moved mode into it. I've also moved it closer to the actual function definition so it's easier to distinguish between the two options types.
There was a problem hiding this comment.
Thanks for the changes! The term "options" still seems a bit off to me because it makes me think of optional or variadic arguments, but I don't have a good suggestions atm (only "inputs" comes to mind).
This updates the LLM functionality to use the new request/response format and the query included in codeql when the
codeQL.dataExtensions.llmGenerationV2config setting is enabled.The first two commits clean up the query resolver for contextual queries so that it's easier to re-use that functionality for resolving non-contextual queries. The last commit uses this to do the following:
automodel <application-mode/framework-mode> candidatesfrom the CodeQL libraries (either submodule or query pack)Checklist
ready-for-doc-reviewlabel there.