-
Notifications
You must be signed in to change notification settings - Fork 682
Update docs to reflect you need version for Azure Foundry #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add Custom Providers section to Node.js, Go, and Python READMEs - Document ProviderConfig options with examples for Ollama, OpenAI-compatible APIs, and Azure OpenAI - Add SessionConfig documentation with provider option - Highlight important notes: - Model is required when using custom providers - Azure endpoints require type 'azure', not 'openai' - Base URL should not include /openai/v1 path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates the language SDK READMEs to document session configuration options for BYOK/custom providers (including Azure) and adds custom provider usage examples.
Changes:
- Add
provider/custom provider documentation and examples (Python/Node/Go). - Clarify session config fields (notably
model) in each README. - Add Azure-specific provider guidance (type, base URL shape, API version).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| python/README.md | Adds SessionConfig bullets plus a new “Custom Providers” section with Python examples and Azure notes. |
| nodejs/README.md | Updates createSession config docs and adds a “Custom Providers” section with TS examples and Azure notes. |
| go/README.md | Adds SessionConfig/ResumeSessionConfig bullets and a “Custom Providers” section with Go examples and Azure notes. |
Comments suppressed due to low confidence (4)
python/README.md:349
- These “Important notes” claim the SDK throws/returns an error if
modelis omitted with a custom provider, but the SDK currently forwardsproviderwithout validatingmodel(and tests cover provider-only configs). Either remove/soften this guarantee (e.g., “the server may require…”) or add explicit validation increate_session/createSession/CreateSessionto actually throw.
> **Important notes:**
> - When using a custom provider, the `model` parameter is **required**. The SDK will throw an error if no model is specified.
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `type: "azure"`, not `type: "openai"`.
nodejs/README.md:90
- The new docs say
modelis required when using a custom provider, but the Node SDK currently sendsmodel: config.modelwithout enforcing that it is present whenprovideris set, and e2e tests use a provider without a model. Please align the docs with actual behavior or add validation increateSession.
- `model?: string` - Model to use ("gpt-5", "claude-sonnet-4.5", etc.). **Required when using custom provider.**
- `tools?: Tool[]` - Custom tools exposed to the CLI
nodejs/README.md:423
azure?.apiVersion?: stringisn’t valid TypeScript and doesn’t match the actualProviderConfigshape (it’sazure?: { apiVersion?: string }in nodejs/src/types.ts). Please update this bullet to reflect the nested object.
- `azure?.apiVersion?: string` - Azure API version (default: "2024-10-21")
go/README.md:108
- This new
SessionConfigbullet list looks like an API reference, but it omits several existingSessionConfigfields from go/types.go (e.g.,ConfigDir,AvailableTools,ExcludedTools,OnPermissionRequest,MCPServers,CustomAgents,SkillDirectories,DisabledSkills). Either document the full struct here or explicitly label this list as non-exhaustive to avoid misleading readers.
**SessionConfig:**
- `Model` (string): Model to use ("gpt-5", "claude-sonnet-4.5", etc.). **Required when using custom provider.**
- `SessionID` (string): Custom session ID
- `Tools` ([]Tool): Custom tools exposed to the CLI
- `SystemMessage` (\*SystemMessageConfig): System message configuration
- `Provider` (\*ProviderConfig): Custom API provider configuration (BYOK). See [Custom Providers](#custom-providers) section.
- `Streaming` (bool): Enable streaming delta events
- `InfiniteSessions` (\*InfiniteSessionConfig): Automatic context compaction configuration
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Custom Providers | ||
|
|
||
| The SDK supports custom OpenAI-compatible API providers (BYOK - Bring Your Own Key), including local providers like Ollama. When using a custom provider, you must specify the `model` explicitly. |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs state that when using a custom provider you must specify model and that the SDK will throw an error otherwise, but the SDK currently allows creating sessions with provider and no model (e.g., python/e2e/test_session.py creates a session with provider only). Please update this text to match actual behavior, or implement/enforce this validation in the SDK if it is truly required.
|
|
||
| > **Note:** When using a custom provider, the `Model` parameter is **required**. The SDK will return an error if no model is specified. | ||
| > **Important notes:** | ||
| > - When using a custom provider, the `Model` parameter is **required**. The SDK will return an error if no model is specified. |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section states that model is required for custom providers and that the SDK will throw/return an error if it’s missing, but the Go SDK currently allows creating/resuming sessions with a Provider and an empty Model (and tests cover provider-only configs). Please update the docs to match, or add validation in the client to enforce the requirement.
| > - When using a custom provider, the `Model` parameter is **required**. The SDK will return an error if no model is specified. | |
| > - When using a custom provider, specifying the `Model` parameter is **recommended**, but the Go SDK does **not** currently enforce it. If you omit `Model`, behavior (such as using a provider-specific default model or returning an error) depends on your configured provider. |
| **Example with Azure OpenAI:** | ||
|
|
||
| ```python | ||
| import os | ||
|
|
||
| session = await client.create_session({ | ||
| "model": "gpt-4", | ||
| "provider": { | ||
| "type": "azure", # Must be "azure" for Azure endpoints, NOT "openai" | ||
| "base_url": "https://my-resource.openai.azure.com", # Just the host, no path | ||
| "api_key": os.environ["AZURE_OPENAI_KEY"], | ||
| "azure": { | ||
| "api_version": "2024-10-21", | ||
| }, |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR title mentions “need version for Azure Foundry”, but the added documentation focuses on BYOK/custom providers and doesn’t mention Azure Foundry-specific versioning requirements beyond the generic api_version example/default. Please adjust the title or add the missing Azure Foundry guidance so the PR intent matches the content.
No description provided.