feat: OpenAI/compatible models (such as Azure OpenAI) can declare if they use the response API instead via use_openai_responses_api

This commit is contained in:
Fahad
2025-10-04 21:20:47 +04:00
parent ff9a07a37a
commit 3824d13161
5 changed files with 19 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ Without the key and endpoint the provider is skipped entirely. Leave the key bla
## 2. Define Deployments in `conf/azure_models.json`
Azure models live in `conf/azure_models.json` (or the file pointed to by `AZURE_MODELS_CONFIG_PATH`). Each entry follows the same schema as [`ModelCapabilities`](../providers/shared/model_capabilities.py) with one additional required key: `deployment`. This field must exactly match the deployment name shown in the Azure Portal (for example `prod-gpt4o`). The provider routes requests by that value, so omitting it or using the wrong name will cause the server to skip the model.
Azure models live in `conf/azure_models.json` (or the file pointed to by `AZURE_MODELS_CONFIG_PATH`). Each entry follows the same schema as [`ModelCapabilities`](../providers/shared/model_capabilities.py) with one additional required key: `deployment`. This field must exactly match the deployment name shown in the Azure Portal (for example `prod-gpt4o`). The provider routes requests by that value, so omitting it or using the wrong name will cause the server to skip the model. You can also opt into extra behaviour per model—for example set `use_openai_response_api` to `true` when an Azure deployment requires the `/responses` endpoint (O-series reasoning models), or leave it unset for standard chat completions.
```json
{
@@ -30,7 +30,8 @@ Azure models live in `conf/azure_models.json` (or the file pointed to by `AZURE_
"max_output_tokens": 128000,
"supports_temperature": false,
"temperature_constraint": "fixed",
"aliases": ["gpt4o-eu"]
"aliases": ["gpt4o-eu"],
"use_openai_response_api": false
}
]
}
@@ -41,6 +42,7 @@ Tips:
- Copy `conf/azure_models.json` into your repo and commit it, or point `AZURE_MODELS_CONFIG_PATH` at a custom path.
- Add one object per deployment. Aliases are optional but help when you want short names like `gpt4o-eu`.
- All capability fields are optional except `model_name`, `deployment`, and `friendly_name`. Anything you omit falls back to conservative defaults.
- Set `use_openai_response_api` to `true` for models that must call Azure's `/responses` endpoint (for example O3 deployments). Leave it unset for standard chat completions.
## 3. Optional Restrictions