Skip to content

Conversation

@cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Jan 5, 2026

  • Adds reasoning parameter to ChatAzureOpenAI() for users to explicitly enable reasoning features

Usage

from chatlas import ChatAzureOpenAI

# For reasoning model deployments (o-series), pass the reasoning parameter:
chat = ChatAzureOpenAI(
    endpoint="https://your-resource.openai.azure.com",
    deployment_id="my-o3-deployment",  # custom name
    api_version="2024-10-21",
    reasoning="medium",  # enables reasoning features
)

Test plan

  • All existing tests pass (451 passed)
  • Type checking passes with pyright

Fixes #242

🤖 Generated with Claude Code

cpsievert and others added 3 commits January 5, 2026 11:56
…etection

Azure OpenAI uses custom deployment IDs instead of model names, so the
existing `is_reasoning_model()` check (which looks for "o" or "gpt-5"
prefixes) doesn't work. This adds a `reasoning` parameter to
`ChatAzureOpenAI()` that users can set to enable reasoning features for
their o-series deployments.

Changes:
- Add `_is_reasoning_model` attribute to `OpenAIProvider`
- Use `self._is_reasoning_model` instead of `is_reasoning_model(self.model)`
  in `_chat_perform_args()` to determine whether to include reasoning content
- Add `reasoning` parameter to `ChatAzureOpenAI()` matching `ChatOpenAI()`
- Fix type annotations to use `ResponsesSubmitInputArgs` and `Response`
  (since Azure uses the responses API, not completions)

Fixes #242

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
When deployment_id matches known reasoning model patterns (o*, gpt-5*),
automatically enable reasoning features. This maintains backward
compatibility with existing tests while still allowing explicit
override via the reasoning parameter for custom deployment names.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This way, for Azure, an empty dictionary will lead to encrypted content being included
@cpsievert cpsievert changed the title fix: add reasoning parameter to ChatAzureOpenAI for reasoning model detection feat: add reasoning parameter to ChatAzureOpenAI() Jan 5, 2026
@cpsievert cpsievert merged commit 96c7502 into main Jan 5, 2026
8 checks passed
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.

Azure OpenAI - _is_reasoning() logic is fragile

2 participants