feat: update config endpoints for use with providers#1563
Conversation
a089878 to
2ad2b62
Compare
30e174d to
3f3f430
Compare
There was a problem hiding this comment.
Added some more routes and schemas so openapi can create client-side functions for the UI to use to avoid needing to generate the types and client functions to call the backend.
There was a problem hiding this comment.
the real changes are here -- added an endpoint called providers which fetches provider metadata (name, description, keys etc) and if each provider is configured or not and returns that to the frontend
also updated other endpoints to verify that there's a secret key in the headers of the request for security -- this is something we do currently when fetching information on providers and extensions but we forgot to include it in the first iteration
There was a problem hiding this comment.
helper functions for the providers endpoint -- looks up information on if keys are set or not for the providers and determines if all required keys are set or not. will return key value in the response if not secret
There was a problem hiding this comment.
just renamed get to get_param and set to set_param
There was a problem hiding this comment.
Added the get(key, is_secret) and set(key, value, is_secret) methods and renamed the old get(key) and set(key, value) functions to get_param and set_param
There was a problem hiding this comment.
this file is auto-generated -- has the some updated information for the frontend on the different routes and schemas
michaelneale
left a comment
There was a problem hiding this comment.
yes looks like a big refactor!
* main: feat: enable smart approve for user by default (#1599) ui: fix modal state (#1598) ui: setting configuration (#1597) fix: merge error logging in goose bench (#1545) feat: add additional goosebench evals (#1571) chore: update types and imports (#1594) Retain session through view changes (#1580) docs: Add steps for desktop tutorial (#1590) remove env vars from bottom menu model setting (#1584) Fix Goosehints modal UI (#1581) docs: typo fix (#1593) feat: update config endpoints for use with providers (#1563) fix: update anthropic provider headers (#1592) feat: Build Goose in a Docker Container (#1551) docs: voyp blog post (#1588)
One change that touched many files so it looks bigger than it is:
All pre-existing uses of
setare nowset_paramand uses ofgetareget_param-- same function, just different name nowBefore
get(key)-- the config method to fetch a non-secretget_secret(key)-- the config method to fetch a secretset(key, value)-- the config method to set a non-secretset_secret(key, value)-- the config method to set a secretAfter
get_param(key)-- the config method to fetch a non-secretget_secret(key)-- the config method to fetch a secretset_param(key, value)-- the config method to set a non-secretset_secret(key, value)-- the config method to set a secretget(key, is_secret)-- the config method to fetch any key -- usesget_paramandget_secretbased on value ofis_secretset(key, value, is_secret)-- the config method to get any key -- usesset_paramandset_secretbased on value ofis_secretWhy?
getfunction to always check all places for a secret makes it less complicated for the config endpoints that the frontend uses. we still never return the actual value of the secrets, but this way we have one method to call and it will handle the lookup or settingis_secretfor setting and getting parameters a lot, so this creates parity as wellRest of changes
State of new settings at end of this PR:
Next: