Allow "reasoning" for extra-openai-models.yaml (#766)

* Allow "reasoning" for extra-openai-models.yaml

Currently you get an error when trying to use `-o reasoning_effort high` with a model that has been defined in `extra-openai-models.yaml`. 
This allows a `reasoning` field.

* Mention reasoning: true in other OpenAI models docs

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
Kasper Primdal Lauritzen 2025-02-27 06:50:14 +01:00 committed by GitHub
parent 02999e398d
commit 6cb16a1d1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -123,6 +123,8 @@ The `model_id` is the identifier that will be recorded in the LLM logs. You can
If the model is a completion model (such as `gpt-3.5-turbo-instruct`) add `completion: true` to the configuration.
For reasoning models like `o1` or `o3-mini` add `reasoning: true`.
With this configuration in place, the following command should run a prompt against the new model:
```bash

View file

@ -107,6 +107,7 @@ def register_models(register):
api_version = extra_model.get("api_version")
api_engine = extra_model.get("api_engine")
headers = extra_model.get("headers")
reasoning = extra_model.get("reasoning")
kwargs = {}
if extra_model.get("can_stream") is False:
kwargs["can_stream"] = False
@ -122,6 +123,7 @@ def register_models(register):
api_version=api_version,
api_engine=api_engine,
headers=headers,
reasoning=reasoning,
**kwargs,
)
if api_base: