add support for 'high'/'medium'/'low' think values

currently only supported on gpt-oss, but as more models come out with
support like this we'll likely relax the particular values that can be
provided
This commit is contained in:
Devon Rifkin
2025-08-07 14:39:36 -07:00
parent 34e98bd237
commit aa4b476f26
4 changed files with 40 additions and 11 deletions

View File

@@ -207,7 +207,7 @@ class GenerateRequest(BaseGenerateRequest):
images: Optional[Sequence[Image]] = None
'Image data for multimodal models.'
think: Optional[bool] = None
think: Optional[Union[bool, Literal['low', 'medium', 'high']]] = None
'Enable thinking mode (for thinking models).'
@@ -357,7 +357,7 @@ class ChatRequest(BaseGenerateRequest):
tools: Optional[Sequence[Tool]] = None
'Tools to use for the chat.'
think: Optional[bool] = None
think: Optional[Union[bool, Literal['low', 'medium', 'high']]] = None
'Enable thinking mode (for thinking models).'