- Notifications
You must be signed in to change notification settings - Fork923
feat: add the /aitasks/prompts endpoint#18464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
a03b14b
to16dd56a
Compareaa79b8d
toe9e6341
Comparee4abd39
tod80c61a
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
DefaultValue: "default1", | ||
}, | ||
{ | ||
Name: codersdk.AITaskPromptParameterName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The provider exposes this, let's rather use that please.
https://github.com/coder/terraform-provider-coder/blob/main/provider/ai_task.go#L22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'll change that once we upgrade the coder provider on main and I rebase this branch. I don't want to do it before because it's likely to result in merge conflicts later.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@@ -1494,6 +1494,10 @@ func New(options *Options) *API { | |||
r.Use(apiKeyMiddleware) | |||
r.Get("/", api.tailnetRPCConn) | |||
}) | |||
r.Route("/aitasks", func(r chi.Router) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Blocker: we need to finalize whether this will be a v2 endpoint or experimental.
} | ||
} | ||
filteredParameters := make([]database.WorkspaceBuildParameter, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Curious about the 0 length here; what's your intent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wanted to initialize a completely empty array, since it's impossible to know what size we'll need. Some builds may have no parameters, some may have many.
d80c61a
to7d66f2e
Compare
Uh oh!
There was an error while loading.Please reload this page.
Add an endpoint to fetch AI task prompts for multiple workspace builds at the same time. A prompt is the value of the "AI Prompt" workspace build parameter. On main, the only way our API allows fetching workspace build parameters is by using the
/workspacebuilds/$build_id/parameters
endpoint, requiring a separate API call for every build.The Tasks dashboard fetches Task workspaces in order to show them in a list, and then needs to fetch the value of the
AI Prompt
parameter for every task workspace (using its latest build id), requiring an additional API call for each list item. This endpoint will allow the dashboard to make just 2 calls to render the list: one to fetch task workspaces, the other to fetch prompts.Related tocoder/internal#660.