Skip to content

feat: add Azure OpenAI LLMAdapter (#24)#143

Merged
JackChen-me merged 1 commit into
open-multi-agent:mainfrom
Klarline:feature/azure-openai-adapter
Apr 21, 2026
Merged

feat: add Azure OpenAI LLMAdapter (#24)#143
JackChen-me merged 1 commit into
open-multi-agent:mainfrom
Klarline:feature/azure-openai-adapter

Conversation

@Klarline
Copy link
Copy Markdown
Contributor

  • New AzureOpenAIAdapter using AzureOpenAI client from openai SDK
  • Registered 'azure-openai' in SupportedProvider and createAdapter()
  • model field is primary deployment name; AZURE_OPENAI_DEPLOYMENT as fallback
  • Default api-version: 2024-10-21
  • Example in examples/providers/azure-openai.ts
  • 14 tests covering chat, stream, tool_use, deployment fallback, error path
  • Updated README.md, README_zh.md, examples/README.md, src/cli/oma.ts

What

Adds AzureOpenAI as a first-class provider (provider: 'azure-openai') with a dedicated adapter using the AzureOpenAI client from the openai SDK.

Why

Azure OpenAI's deployment-based URL scheme and api-version query parameter don't work cleanly with a plain baseURL override, so a dedicated adapter is warranted.

Fixes #24

Design decision: model vs AZURE_OPENAI_DEPLOYMENT

The issue spec lists AZURE_OPENAI_DEPLOYMENT as an env var. After reviewing how existing providers work, I kept the primary pattern consistent with the rest of the framework: the model field in AgentConfig is the deployment name, same as how other providers use model.

AZURE_OPENAI_DEPLOYMENT is supported as an optional fallback — if model is blank, the adapter falls back to the env var, and throws a clear error if neither is set.

// Recommended (consistent with all other providers)
const agent: AgentConfig = {
  provider: 'azure-openai',
  model: 'my-gpt4-deployment',
}

// Also works (env var fallback)
// AZURE_OPENAI_DEPLOYMENT=my-gpt4-deployment
const agent: AgentConfig = {
  provider: 'azure-openai',
  model: '',
}

Env vars

Variable Required Notes
AZURE_OPENAI_API_KEY Yes Azure API key
AZURE_OPENAI_ENDPOINT Yes e.g. https://my-resource.openai.azure.com
AZURE_OPENAI_API_VERSION No Defaults to 2024-10-21
AZURE_OPENAI_DEPLOYMENT No Fallback if model field is blank

Checklist

  • npm run lint passes
  • npm test passes (647 total, 14 new for this adapter)
  • Added/updated tests for changed behavior
  • No new runtime dependencies

- New AzureOpenAIAdapter using AzureOpenAI client from openai SDK
- Registered 'azure-openai' in SupportedProvider and createAdapter()
- model field is primary deployment name; AZURE_OPENAI_DEPLOYMENT as fallback
- Default api-version: 2024-10-21
- Example in examples/providers/azure-openai.ts
- 14 tests covering chat, stream, tool_use, deployment fallback, error path
- Updated README.md, README_zh.md, examples/README.md, src/cli/oma.ts
@JackChen-me JackChen-me merged commit 99d9d7f into open-multi-agent:main Apr 21, 2026
4 checks passed
@JackChen-me
Copy link
Copy Markdown
Member

LGTM, merged. Will probably dedupe the stream logic between this and openai.ts at some point, not your problem.

JackChen-me added a commit that referenced this pull request Apr 22, 2026
* docs: restructure Ecosystem section, add Engram integration

Merge Used by and Integrations into one ## Ecosystem section with three
tiers (In production, Integrations free, Featured Partner $3,000/yr).
Drop Philosophy section (covered in DECISIONS.md). Add Engram to free
tier with maintainer's original tagline verbatim. Mirror in README_zh.md.

* chore: add repository, homepage, and bugs npm metadata

Standard fields so npm and GitHub surface source links.

* docs: README consistency pass

- Architecture diagram: add AzureOpenAIAdapter (missed when #143 landed).
- Quick Start: promote CLI (oma) to ### subheading for discoverability.
- Ecosystem: drop hardcoded "5,500+ stars"; shield badge is the live source.
- Intro: bump "Opus 4.6" example to "Opus 4.7" (prose only; code defaults
  unchanged, to revisit separately).
- Supported providers: drop the "Gemma 4" sentence that contradicted the
  5-model list below it.
- Stats images: bump cache-buster to 20260423 for contrib.rocks and
  star-history so GitHub camo refetches.

Mirror in README_zh.md.
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.

[Feature] Azure OpenAI LLMAdapter

2 participants