#How to fix this error in OpenAI Agents SDK

24 messages · Page 1 of 1 (latest)

fierce wolf
#

Error msg: AsyncOpenAI is not assignable to ModelProvider
Thing is that I am using OpenAI Agents SDK and in my Python fiel, I made thing like:
external_client = AsyncOpenAI(api_key=.., base_url=...)
and also:
config = RunConfig(model=model, openai_client=external_client..)
and while i was doing this i got error

primal patrol
#

There's an OpenAI Discord with lots of experts troubleshooting it?

fierce wolf
#

where is it

#

idk

quiet harborBOT
#

❌ @primal patrol you are not allowed to share Discord invites in this channel.

#

❌ @primal patrol you are not allowed to share Discord invites in this channel.

primal patrol
#

I get what the bot is doing, we don't want to see jerks advertise but dang it's out of context on this one. LOL
discord.gg/CnaMJsSt

fierce wolf
#

can't you just dm me

#

the links

limpid star
#

Can you share your code

#

I just checked and I can get the OpenAI package to connect to Gemini

fierce wolf
quiet harborBOT
#

-# :warning: Files from unknown sources can be dangerous. Download with care. :warning:

fierce wolf
#

pls man @limpid star do soemthing it is now midnight

#

my laptop is running down and i can't do like chainlit UI is showing but when I typed anythign it just didn't response to me

limpid star
#

Is that code giving errors or just not responding?

limpid star
#

I'll be honest, you may just be jumping into the deep end too fast. I've got Gemini working with openai using this script:

from openai import OpenAI

client = OpenAI(
    api_key="GEMINI_TOKEN",
    base_url="https://generativelanguage.googleapis.com/v1beta/openai/"
)

response = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {
            "role": "user",
            "content": "Explain to me how AI works"
        }
    ]
)

print(response.choices[0].message)

Dead simple, doesn't do anything but connect to Gemini and get a response to a simple prompt.

#

Go step by step and build up to the working thing you want

fierce wolf
#

"error": {
"message": "Incorrect API key provided: sk-fakek**************cdef. You can find your API key at https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": "invalid_api_key"

#

this is the error

fierce wolf
#

i even used openai keys

#

but it is not working

sour pelican
#

I assume you read the error message and checked your api key?