#OpenAi api key error

1 messages · Page 1 of 1 (latest)

final hawk
#

I have azure open ai credentials and I have updated the configuration but when I run the doc agent code it still asks for open ai key. How do I make it use azure instead of direct open ai?

sharp plover
final hawk
#

Yes i added azure credentials in this form,

#

But still it's trying to access open ai

sharp plover
teal owl
#

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}")
stuck fractal
#

Would you be able to add the trace so we can see where it's failing.

teal owl
#

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

stuck fractal
#

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.

teal owl
digital kraken
teal owl
#

Yes I do

stuck fractal
#

@teal owl can you also update to the latest 0.8.3 as well, just because we fix for LLMConfig

teal owl
#

Yes,. I'm on that version

#

I just want to know how to structure the Azure OpenAI

turbid aurora
#

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

teal owl
#

@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:

turbid aurora
#

I am out to dinner, but yeah will try and help tonight when I get home

teal owl
#

thanks by the way, enjoy your dinner @turbid aurora

turbid aurora
#

I just verified that working.

#

That is the page with the info you need

#

@teal owl good luck

teal owl
#

@turbid aurora thanks! hope dinner went well

#

must I use the json config list ¿

turbid aurora
#

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

teal owl
#

bet! Thanks for this! very helpful