#OpenAi api key error
1 messages · Page 1 of 1 (latest)
it must be in this form:
[
{
"model": "gpt-4o",
"api_key": "",
"base_url": "",
"api_type": "azure",
"api_version": "2025-02-01-preview"
}
]
did you pass this llm_config into your agent?
I'm running into this issue, did you solve this ?
I have mine like this but it keeps failing <@&1163153821850161182> anyone know about ow to solve this ?
# Extract base URL (just the hostname part without paths or query params)
from urllib.parse import urlparse
parsed_url = urlparse(target_url)
base_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
# Create config exactly in the required format for Azure OpenAI
config = {
"api_type": "azure",
"model": deployment, # Use deployment name as the model
"api_key": api_key,
"api_version": self.azure_api_version,
"base_url": base_url,
}
logger.info(f"Configured Azure OpenAI with base_url={base_url}, model={deployment}")
Would you be able to add the trace so we can see where it's failing.
here it is, I was just wondering if there is a for us to set these up like a turoial
since I want to setup these apis
AZURE_GPT4O (standard GPT-4 Turbo)
AZURE_GPT4O_AUDIO_PREVIEW
AZURE_GPT4O_REALTIME_PREVIEW
AZURE_DEEPSEEK_R1
AZURE_PHI4_MULTIMODAL
AZURE_O3_MINI
I have it working on other libraries
Thanks for the quick chat @teal owl, if you're able to check your configuration works with a ConversableAgent that will help identify where the issue may be.
Will update you later tonight on this
Do you have gpt-4o deployed on azure AI foundry?
Yes I do
@teal owl can you also update to the latest 0.8.3 as well, just because we fix for LLMConfig
I can poke at this when I get back home, I just did azure openai
Will make a quick tutorial
It is finicky as hell, need the right details for endpoint, release date, and version, all lined up
@turbid aurora can you share what you setup since I would liket o make my azure work
here my class maybe it can help you see the direction I'm headed in:
I am out to dinner, but yeah will try and help tonight when I get home
Bet! I'll try this https://docs.ag2.ai/docs/user-guide/advanced-concepts/llm-configuration-deep-dive but if the docs aren't correct let me know
thanks by the way, enjoy your dinner @turbid aurora
I just verified that working.
That is the page with the info you need
@teal owl good luck
pretty much yeah, you can put the json in a file called OAI_CONFIG_LIST which is what most do, but first I would get that file working
One thing, check the target URI for the model version
Mine says 2024-07-18 but the URI says 2025-01-01-preview which workw
Which is why I gave you the whole block, if you do a new 4o-mini deployment, you should just need the base (mybots.openai.azure.com in my case) and the key
bet! Thanks for this! very helpful