Skip to content

Commit b0e644b

Browse files
authored
Merge pull request #22823 from Chesars/docs/thinking-summary-field
docs: add thinking.summary field to /v1/messages and reasoning docs
2 parents 5c1e016 + 57c0b46 commit b0e644b

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

docs/my-website/docs/anthropic_unified/index.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,12 +506,15 @@ Request body will be in the Anthropic messages API format. **litellm follows the
506506
A system prompt providing context or specific instructions to the model.
507507
- **temperature** (number):
508508
Controls randomness in the model's responses. Valid range: `0 < temperature < 1`.
509-
- **thinking** (object):
509+
- **thinking** (object):
510510
Configuration for enabling extended thinking. If enabled, it includes:
511-
- **budget_tokens** (integer):
511+
- **budget_tokens** (integer):
512512
Minimum of 1024 tokens (and less than `max_tokens`).
513-
- **type** (enum):
513+
- **type** (enum):
514514
E.g., `"enabled"`.
515+
- **summary** (string, optional):
516+
Enables the summary style for thinking blocks. Possible values: `"auto"`, `"concise"`, `"detailed"`, `"disabled"`.
517+
When routing to non-Anthropic providers (e.g., `openai/gpt-5.1`), the `summary` value is preserved and forwarded to the downstream API.
515518
- **tool_choice** (object):
516519
Instructs how the model should utilize any provided tools.
517520
- **tools** (array of objects):

docs/my-website/docs/reasoning_content.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,3 +675,19 @@ response = litellm.completion(
675675
reasoning_effort={"effort": "low", "summary": "detailed"}, # Explicit control
676676
)
677677
```
678+
679+
### Summary Preservation via `/v1/messages` Adapter
680+
681+
When using the Anthropic `/v1/messages` adapter to route non-Claude models (e.g., `openai/gpt-5.1`), the `thinking.summary` value is preserved and forwarded to the downstream provider. For example:
682+
683+
```python
684+
import litellm
685+
686+
response = await litellm.anthropic.messages.acreate(
687+
model="openai/gpt-5.1",
688+
messages=[{"role": "user", "content": "Hello"}],
689+
max_tokens=8096,
690+
thinking={"type": "enabled", "budget_tokens": 5000, "summary": "concise"},
691+
)
692+
# The summary="concise" is preserved when routing to OpenAI's Responses API
693+
```

0 commit comments

Comments
 (0)