Skip to content
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

Support MultiEnvAuthStrategy in %ai list, chat UI settings panel #525

Closed
JasonWeill opened this issue Dec 18, 2023 · 0 comments · Fixed by #531
Closed

Support MultiEnvAuthStrategy in %ai list, chat UI settings panel #525

JasonWeill opened this issue Dec 18, 2023 · 0 comments · Fixed by #531

Comments

@JasonWeill
Copy link
Collaborator

Problem

When I was evaluating PR #478 by @markqiu, I noticed that the new QianfanEmbeddingsEndpointProvider and QianfanProvider use MultiEnvAuthStrategy, with keys QIANFAN_AK and QIANFAN_SK.

%ai list does not show either of these keys:

Screenshot 2023-12-18 at 3 20 21 PM

The Chat UI settings panel does not show inputs for either of these keys when a Qianfan model is selected:

Screenshot 2023-12-18 at 3 23 26 PM

Proposed Solution

Modify %ai list to display and check all keys when a MultiEnvAuthStrategy model is being used.

Modify the chat UI's settings panel to display inputs for all keys when a MultiEnvAuthStrategy model is being used.

Additional context

See this comment in magics.py:

# validate presence of authn credentials
auth_strategy = self.providers[provider_id].auth_strategy
if auth_strategy:
# TODO: handle auth strategies besides EnvAuthStrategy
if auth_strategy.type == "env" and auth_strategy.name not in os.environ:
raise OSError(
f"Authentication environment variable {auth_strategy.name} not provided.\n"
f"An authentication token is required to use models from the {Provider.name} provider.\n"
f"Please specify it via `%env {auth_strategy.name}=token`. "
) from None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant