unsloth/studio/frontend/src/features
maattm 930dd17086
feat: add Anthropic-compatible thinking parameter (#5856)
* feat: add Anthropic-compatible thinking parameter

Add `thinking` parameter using Anthropic's format ({type: 'disabled'} /
{type: 'enabled'}) alongside the existing `enable_thinking` boolean for
backward compatibility.

The new parameter is mapped internally to `enable_thinking` at the route
layer so all downstream templates and backends continue to work unchanged.

Changes:
- Add ThinkingConfig model and `thinking` field to ChatCompletionRequest
- Add mapping logic in routes: thinking.type -> enable_thinking
- Add `thinking` field to frontend TypeScript types
- Update frontend request building to send thinking parameter
- Add tests for new thinking parameter

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix: move thinking→enable_thinking mapping to model_validator

The Gemini review correctly identified that the route-level mapping
bypasses normalization for external provider requests. Moving the
mapping into a @model_validator on ChatCompletionRequest ensures it
runs during Pydantic validation regardless of routing path.

* Document ThinkingConfig scope and thinking validation behavior

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Daniel Han <danielhanchen@gmail.com>
Co-authored-by: Lee Jackson <130007945+Imagineer99@users.noreply.github.com>
2026-06-15 10:35:33 +01:00
..
auth Studio: UI polish for sidebar, menus, hub and toasts (#6288) 2026-06-13 03:50:36 -07:00
chat feat: add Anthropic-compatible thinking parameter (#5856) 2026-06-15 10:35:33 +01:00
data-recipes Studio: UI polish for sidebar, menus, hub and toasts (#6288) 2026-06-13 03:50:36 -07:00
export Studio: UI polish for sidebar, menus, hub and toasts (#6288) 2026-06-13 03:50:36 -07:00
hub Studio: UI polish for sidebar, menus, hub and toasts (#6288) 2026-06-13 03:50:36 -07:00
native-intents Studio: add HTML artifacts to chat (#5772) 2026-06-01 08:35:18 +02:00
onboarding Studio: mascot images degrade gracefully instead of showing alt text (#6146) 2026-06-10 08:22:17 -07:00
profile Studio: UI polish for sidebar, menus, hub and toasts (#6288) 2026-06-13 03:50:36 -07:00
rag Studio: clearer check mark and even plus-menu hover padding (#6253) 2026-06-12 06:44:08 -07:00
recipe-studio Studio: clearer check mark and even plus-menu hover padding (#6253) 2026-06-12 06:44:08 -07:00
settings Studio: UI polish for sidebar, menus, hub and toasts (#6288) 2026-06-13 03:50:36 -07:00
studio Studio: project sources backed by RAG (#6205) 2026-06-12 15:42:51 +02:00
tour Studio: unify shadows, backgrounds and dark mode consistency in chat UI (#6116) 2026-06-10 03:09:37 -07:00
training MLX Training updates (#5656) 2026-06-14 04:58:50 -07:00