Skip to content

Anybody tried to use AzureChatOpenAI to connect Gemini? #8387

Answered by dosubot bot
postbird asked this question in Q&A
Discussion options

You must be logged in to vote

AzureChatOpenAI is specifically built for Azure's OpenAI-compatible endpoints and expects payloads and tool/function schemas that match the OpenAI API. Gemini models (like ggemini-2.5-pro-preview-06-05) use a different API and schema, so AzureChatOpenAI can't connect to Gemini models directly—this is why you're seeing the JSON payload error about unknown fields like $schema in function declarations. The error is due to a mismatch between the expected OpenAI/Azure schema and Gemini's schema requirements, not a bug in your code or configuration reference.

If you need Gemini support in LangChain, you should use the dedicated integration for Gemini models, such as ChatGoogleGenerativeAI from…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by postbird
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant