-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: update config endpoints for use with providers #1563
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
a089878 to
2ad2b62
Compare
30e174d to
3f3f430
Compare
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just renamed get to get_param and set to set_param
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
* upstream/main: (48 commits) feat: enable smart approve for user by default (block#1599) ui: fix modal state (block#1598) ui: setting configuration (block#1597) fix: merge error logging in goose bench (block#1545) feat: add additional goosebench evals (block#1571) chore: update types and imports (block#1594) Retain session through view changes (block#1580) docs: Add steps for desktop tutorial (block#1590) remove env vars from bottom menu model setting (block#1584) Fix Goosehints modal UI (block#1581) docs: typo fix (block#1593) feat: update config endpoints for use with providers (block#1563) fix: update anthropic provider headers (block#1592) feat: Build Goose in a Docker Container (block#1551) docs: voyp blog post (block#1588) fix: included files was panicing because dir didnt exist (block#1583) feat: work with docs/xls and simple html (block#1526) feat: parallel processing in approve mode (block#1575) Feat: support auto-including dirs in binary/bench-work-dir (block#1576) refactor models component (block#1535) ...
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: