Skip to content

Python: docs: add Doubleword chat client example#5335

Open
sejori wants to merge 3 commits intomicrosoft:mainfrom
sejori:docs/add-doubleword-provider
Open

Python: docs: add Doubleword chat client example#5335
sejori wants to merge 3 commits intomicrosoft:mainfrom
sejori:docs/add-doubleword-provider

Conversation

@sejori
Copy link
Copy Markdown

@sejori sejori commented Apr 17, 2026

Summary

Adds a sample showing how to use the Microsoft Agent Framework with Doubleword's OpenAI-compatible inference API.

Since Doubleword exposes a standard OpenAI-compatible API, it works with the existing OpenAIChatCompletionClient — just set base_url and api_key. No new package needed.

The sample is at python/samples/02-agents/chat_client/doubleword_chat_client.py.

Doubleword is an AI model gateway providing unified routing, management, and security for inference across multiple model providers, with up to 90% cost savings via the Doubleword Inference API batch pricing.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 17, 2026 15:08
@github-actions github-actions Bot changed the title docs: add Doubleword chat client example Python: docs: add Doubleword chat client example Apr 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Python sample demonstrating how to use the Agent Framework’s existing OpenAIChatCompletionClient against Doubleword’s OpenAI-compatible inference API by configuring base_url and api_key.

Changes:

  • Introduces a new doubleword_chat_client.py sample showing a basic non-streaming chat completion request via Doubleword.
  • Documents required setup (install optional OpenAI integration + set DOUBLEWORD_API_KEY) and provides a short sample output snippet.

Comment thread python/samples/02-agents/chat_client/doubleword_chat_client.py Outdated
@sejori
Copy link
Copy Markdown
Author

sejori commented Apr 20, 2026

@microsoft-github-policy-service agree company="Doubleword"

@sejori
Copy link
Copy Markdown
Author

sejori commented Apr 20, 2026

@moonbox3 please advise if this is acceptable - many thanks

sejori and others added 3 commits April 27, 2026 17:10
Shows how to use autobatcher's BatchOpenAI as the async_client parameter
for OpenAIChatCompletionClient, enabling batch pricing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mirror the existing main_batch() block with main_async(), using
autobatcher.AsyncOpenAI (1h flex tier) instead of BatchOpenAI (24h).
Updates the docstring header to list all three execution modes.
@sejori sejori force-pushed the docs/add-doubleword-provider branch from f28dc53 to 5efe91d Compare April 27, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants