-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
feat(platform): Simplify Credentials UX #8524
feat(platform): Simplify Credentials UX #8524
Conversation
This is exactly what I was thinking! great job! |
I think the devx and ux of this leaves something to be desired still. I think the dev specifying the valid providers as a list would be useful and then it returns one of the credentials depending on the selected API key added. Screen.Recording.2024-11-04.at.9.04.20.PM.movAlso not sure how they are added to the db and filtered but I'm not seeing them after creation, and crashing anytime they're rendered. I think there's an issue somewhere. lmk if you can't replicate |
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.
Tested, needs addtional work
Constraining providers already happens in the backend by specifying edit: it's changed so all possible providers need to be set Regarding bugs and video: everything should now work, including system keys being hidden in the profile. |
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.
autogpt_platform/frontend/src/components/integrations/credentials-input.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/frontend/src/components/integrations/credentials-input.tsx
Show resolved
Hide resolved
// Only one saved credential | ||
} else if ( | ||
savedApiKeys.length === 0 && | ||
savedOAuthCredentials.length === 1 && | ||
selectedCredentials === undefined | ||
) { | ||
if (selectedCredentials === undefined) { | ||
onSelectCredentials({ | ||
id: savedOAuthCredentials[0].id, | ||
type: "oauth2", | ||
provider, | ||
title: savedOAuthCredentials[0].title, | ||
}); | ||
} | ||
return null; | ||
} else if (savedApiKeys.length === 1 && savedOAuthCredentials.length === 0) { | ||
if (selectedCredentials === undefined) { | ||
onSelectCredentials({ | ||
id: savedApiKeys[0].id, | ||
type: "api_key", | ||
provider, | ||
title: savedApiKeys[0].title, | ||
}); | ||
} | ||
return null; |
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.
What's the purpose of this? This whole chain of logic seems questionably necessary.
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.
Reading through this PR, I don't really see why this shortcut is being taken. What's the big hurdle preventing the regular credentials input from working on a multi-provider block?
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'm not sure I understand @Pwuts. The purpose of this code is to choose the only one existing credentials and then not show dropdown at all. I simplified this code.
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.
My question is: would it break anything to allow users the choice of adding their own API key? I understand this will be resolved in a follow-up PR, but I don't immediately see what would break right now if you still showed the credentials picker in all cases.
maybe this error helps |
autogpt_platform/frontend/src/components/integrations/credentials-input.tsx
Outdated
Show resolved
Hide resolved
autogpt_platform/autogpt_libs/autogpt_libs/supabase_integration_credentials_store/types.py
Outdated
Show resolved
Hide resolved
✅ Deploy Preview for auto-gpt-docs canceled.
|
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
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 a note: this really has to be considered a tempfix. Scopes are provider-specific. So is supported_credential_types
. The CredentialsField
was made to handle credentials from a specific provider. If a block supports multiple providers, the discrimination logic should be handled outside the CredentialsField
.
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.
See also #8524 (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.
(I'd like to leave this discussion here for reference in the follow-up PR)
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.
Okay, I'm happy for us to merge this as a much needed temp hotfix and we can adjust that in a follow up.
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
…rovider "llm"(#8674) In #8524, the "llm" credentials provider was replaced. There are still entries with "provider": "llm" in the system though, and those break if not migrated. - SQL migration to fix the obvious ones where we know the provider from `credentials.id` - Non-SQL migration to fix the rest
…rovider "llm" (#8674) In #8524, the "llm" credentials provider was replaced. There are still entries with `"provider": "llm"` in the system though, and those break if not migrated. - SQL migration to fix the obvious ones where we know the provider from `credentials.id` - Non-SQL migration to fix the rest
Current credentials system always forces users to choose correct credentials, even when they are provided by the cloud platform and should be chosen automatically (e.g. there's only one possible choice).
Changes 🏗️
provider
of default credentials to actual provider names (e.g.anthropic
), removellm
providerdiscriminator
anddiscriminator_mapping
toCredentialsField
that allows to filter credentials input to only allow providers for matching models inuseCredentials
hook (thanks @ntindle for the idea!); e.g. user choosesGPT4_TURBO
so then only OpenAI credentials are allowedgetValue
andparseKeys
to utilsANTHROPIC
,GROQ
andOLLAMA
to providers in frontendtypes.ts
hidden
field to credentials that is used for default system keys to hide them in user profileprovider
field inCredentialsField
can accept multiple providers as a listTesting 🔍
Note
Only for the new autogpt platform, currently in autogpt_platform/