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

AutoGen studio not supporting setting API key for Azure OpenAI #5113

Open
zhuohanl opened this issue Jan 20, 2025 · 3 comments
Open

AutoGen studio not supporting setting API key for Azure OpenAI #5113

zhuohanl opened this issue Jan 20, 2025 · 3 comments

Comments

@zhuohanl
Copy link

What happened?

Has anyone tried using Azure OpenAI to configure model within AutoGen studio?

I am trying for the first time and finding it not having a place to set api key for Azure OpenAI
Image

For OpenAI we do have that configuration in place
Image

What did you expect to happen?

We should be able to configure api key for Azure OpenAI as well

How can we reproduce it (as minimally and precisely as possible)?

Use the AutoGen Studio and you will be able to see the UI

AutoGen version

0.4.2

Which package was this bug in

AutoGen Studio

Model used

No response

Python version

No response

Operating system

No response

Any additional info you think would be helpful for fixing this bug

No response

@victordibia
Copy link
Collaborator

victordibia commented Jan 20, 2025

Thanks for tracking this.
You should be able to add this directly in the config json
Add the api_key field.

https://microsoft.github.io/autogen/dev/user-guide/autogenstudio-user-guide/faq.html#q-can-i-use-other-models-with-autogen-studio

Will update once this is fixed

Image

@Zochory
Copy link

Zochory commented Jan 20, 2025

Using the API key is considered not the optimal way to use in production usecase method when using Azure OpenAI, Autogen allows the use of api key, but has a default way for using it throught azure identity and RBAC which doesn't require the api key, but rather being authentifcated through az login/azd auth login
"from azure.identity import DefaultAzureCredential, get_bearer_token_provider" is probably used here only, without the
"from autogen_ext.models.openai import (
AzureOpenAIChatCompletionClient,
OpenAIChatCompletionClient
)"
https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/models.html

which makes the api_key usable

tldr : try to privileged the RBAC and the Cognitive Role appropriate !
or might has been already resolved by Victor !

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 20, 2025

Thanks @Zochory! You can switch to JSON edit mode and add api_key. Though this is not as safe as using azure identity, as explained.

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

No branches or pull requests

4 participants