Skip to content

Update for azure openai compatibility#331

Open
mleary wants to merge 4 commits intomainfrom
docs-chat-with-content-update
Open

Update for azure openai compatibility#331
mleary wants to merge 4 commits intomainfrom
docs-chat-with-content-update

Conversation

@mleary
Copy link
Contributor

@mleary mleary commented Mar 11, 2026

As I tried to update the docs to demonstrate how to connect to Azure OpenAI, I ran into multiple errors. Digging into it more, I believe it was the distinction between model being passed through to ChatAuto and azure openai expecting deployment id. I added some logic to check if the app is trying to use Azure OpenAI and, if so call, a different function. This is similar to how we call AWS Bedrock through ChatBedrockAnthropic.

This approach allowed me to run it successfully on a Connect server.

@mleary mleary requested review from amol- and mconflitti-pbc March 11, 2026 11:13
# `deployment_id` for Azure OpenAI, so we handle it directly.
import json

deployment_id = CHATLAS_CHAT_PROVIDER_MODEL.split("/", 1)[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for my understanding is someone required to enter the model in this way?

CHATLAS_CHAT_PROVIDER_MODEL: azure-openai/{deployment_id} (e.g., azure-openai/gpt-4.1-mini)

it looks like we just want the latter half so can the customer just pass in "gpt-4.1-mini"?

Copy link
Contributor Author

@mleary mleary Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm great point, I was using the existing flow and had tunnel vision for that pattern honestly. That said, in current implementation we need that to determine if it's an azure openai model.

IS_AZURE_OPENAI = (CHATLAS_CHAT_PROVIDER_MODEL or "").startswith("azure-openai/")

I THINK it makes sense to leave it as is so it matches current pattern and we need a way to call out its Azure OpenAI anyways. What do you think @mconflitti-pbc? I need to clean up some commenting from Claude, I disagree with the note and want to make it clearer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is CHATLAS_CHAT_ARGS deprecated now? I think that would be the mechanism for Chatauto to assign the proper args when starting up. Just would need the azure openai ones specifically set.

Based on what I am seeing here: https://posit-dev.github.io/chatlas/reference/ChatAuto.html it should be supported for what you are trying to do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants