Think only supports bool #285

Closed
opened 2026-02-15 16:29:35 -05:00 by yindo · 1 comment
Owner

Originally created by @njbrake on GitHub (Aug 6, 2025).

Found while working on https://github.com/mozilla-ai/any-llm/pull/93

I think it needs to be allowed to accept some literals like 'high', 'medium', 'low', for gpt-oss models at least?

https://github.com/ollama/ollama/issues/11752

RIght now it's pydantic typed as a bool: https://github.com/ollama/ollama-python/blob/main/ollama/_client.py#L277

So i get pydantic validation errors if I try to pass a string

pydantic_core._pydantic_core.ValidationError: 1 validation error for ChatRequest
think
  Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='low', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/bool_parsing
Originally created by @njbrake on GitHub (Aug 6, 2025). Found while working on https://github.com/mozilla-ai/any-llm/pull/93 I think it needs to be allowed to accept some literals like 'high', 'medium', 'low', for gpt-oss models at least? https://github.com/ollama/ollama/issues/11752 RIght now it's pydantic typed as a bool: https://github.com/ollama/ollama-python/blob/main/ollama/_client.py#L277 So i get pydantic validation errors if I try to pass a string ```python pydantic_core._pydantic_core.ValidationError: 1 validation error for ChatRequest think Input should be a valid boolean, unable to interpret input [type=bool_parsing, input_value='low', input_type=str] For further information visit https://errors.pydantic.dev/2.11/v/bool_parsing ```
yindo closed this issue 2026-02-15 16:29:35 -05:00
Author
Owner

@drifkin commented on GitHub (Aug 7, 2025):

fixed in v0.5.3!

@drifkin commented on GitHub (Aug 7, 2025): fixed in v0.5.3!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#285