-
Notifications
You must be signed in to change notification settings - Fork 1.6k
AsyncOpenAI is not work #122
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
Comments
Yes, it didn't work during my test either. I tested Aliyun's and Deepseek's, and neither seemed to work. |
can you show your code?read the doc |
Could you share the code you used to call the third-party API for us to learn from? Thank you. |
from agents import set_default_openai_client
external_client = AsyncOpenAI(
api_key='sk-xxxxxx',
base_url='https://xxxx.xxx.com/compatible-mode/v1/',
)
set_default_openai_client(external_client) |
What is there is no api key required. Am using an azure endpoint. |
@sanjeev-kumar-4 In addition, you need to from openai import AsyncAzureOpenAI
from agents import set_default_openai_client, set_default_openai_api
client = AsyncAzureOpenAI(
api_key='xxxxxx',
base_url='https://xxxx.openai.azure.com/',
api_version="2024-05-01-preview",
)
set_default_openai_client(client, use_for_tracing=False)
set_default_openai_api("chat_completions") |
There's some documentation here: https://openai.github.io/openai-agents-python/models/#using-other-llm-providers I tested the samples with claude and together AI, and they both worked. If it isn't working for you, please let me know what issues you ran into. |
sorry, I have changed the default settings, now,it's worked !! |
I modified the default configuration and it works now, thanks! |
method
AsyncOpenAI
is not work, can not use other LLMsThe text was updated successfully, but these errors were encountered: