You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update docs to reflect you need version for Azure Foundry (github#260)
* Add provider info to docs
* docs: add custom provider documentation across all SDKs
- 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
Type: "azure",// Must be "azure" for Azure endpoints, NOT "openai"
387
+
BaseURL: "https://my-resource.openai.azure.com",// Just the host, no path
388
388
APIKey: os.Getenv("AZURE_OPENAI_KEY"),
389
389
Azure: &copilot.AzureProviderOptions{
390
390
APIVersion: "2024-10-21",
391
391
},
392
392
},
393
393
})
394
394
```
395
-
396
-
> **Note:** When using a custom provider, the `Model` parameter is **required**. The SDK will return an error if no model is specified.
395
+
> **Important notes:**
396
+
> - When using a custom provider, the `Model` parameter is **required**. The SDK will return an error if no model is specified.
397
+
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `Type: "azure"`, not `Type: "openai"`.
398
+
> - The `BaseURL` should be just the host (e.g., `https://my-resource.openai.azure.com`). Do **not** include `/openai/v1` in the URL - the SDK handles path construction automatically.
> **Note:** When using a custom provider, the `model` parameter is **required**. The SDK will throw an error if no model is specified.
468
+
> **Important notes:**
469
+
> - When using a custom provider, the `model` parameter is **required**. The SDK will throw an error if no model is specified.
470
+
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `type: "azure"`, not `type: "openai"`.
471
+
> - The `baseUrl` should be just the host (e.g., `https://my-resource.openai.azure.com`). Do **not** include `/openai/v1` in the URL - the SDK handles path construction automatically.
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.
289
+
290
+
**ProviderConfig fields:**
291
+
292
+
-`type` (str): Provider type - `"openai"`, `"azure"`, or `"anthropic"` (default: `"openai"`)
293
+
-`base_url` (str): API endpoint URL (required)
294
+
-`api_key` (str): API key (optional for local providers like Ollama)
295
+
-`bearer_token` (str): Bearer token for authentication (takes precedence over `api_key`)
296
+
-`wire_api` (str): API format for OpenAI/Azure - `"completions"` or `"responses"` (default: `"completions"`)
297
+
-`azure` (dict): Azure-specific options with `api_version` (default: `"2024-10-21"`)
298
+
299
+
**Example with Ollama:**
300
+
301
+
```python
302
+
session =await client.create_session({
303
+
"model": "deepseek-coder-v2:16b", # Required when using custom provider
"type": "azure", # Must be "azure" for Azure endpoints, NOT "openai"
338
+
"base_url": "https://my-resource.openai.azure.com", # Just the host, no path
339
+
"api_key": os.environ["AZURE_OPENAI_KEY"],
340
+
"azure": {
341
+
"api_version": "2024-10-21",
342
+
},
343
+
},
344
+
})
345
+
```
346
+
347
+
> **Important notes:**
348
+
> - When using a custom provider, the `model` parameter is **required**. The SDK will throw an error if no model is specified.
349
+
> - For Azure OpenAI endpoints (`*.openai.azure.com`), you **must** use `type: "azure"`, not `type: "openai"`.
350
+
> - The `base_url` should be just the host (e.g., `https://my-resource.openai.azure.com`). Do **not** include `/openai/v1` in the URL - the SDK handles path construction automatically.
0 commit comments