Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/celeste/modalities/text/providers/anthropic/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@
streaming=True,
parameter_constraints={
Parameter.MAX_TOKENS: Range(min=1, max=64000),
TextParameter.THINKING_BUDGET: Range(min=-1, max=64000),
TextParameter.THINKING_LEVEL: Choice(
options=["low", "medium", "high", "max"]
),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.TOOLS: ToolSupport(tools=[WebSearch]),
TextParameter.TOOL_CHOICE: ToolChoiceSupport(),
Expand Down
7 changes: 7 additions & 0 deletions src/celeste/modalities/text/providers/mistral/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Mistral models for text modality."""

from celeste.constraints import (
Choice,
DocumentsConstraint,
ImagesConstraint,
Range,
Expand Down Expand Up @@ -69,6 +70,9 @@
parameter_constraints={
Parameter.TEMPERATURE: Range(min=0.0, max=2.0, step=0.01),
Parameter.MAX_TOKENS: Range(min=1, max=32768, step=1),
TextParameter.THINKING_BUDGET: Choice(
options=["none", "minimal", "low", "medium", "high", "xhigh"]
),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.IMAGE: ImagesConstraint(),
TextParameter.DOCUMENT: DocumentsConstraint(),
Expand All @@ -85,6 +89,9 @@
parameter_constraints={
Parameter.TEMPERATURE: Range(min=0.0, max=2.0, step=0.01),
Parameter.MAX_TOKENS: Range(min=1, max=32768, step=1),
TextParameter.THINKING_BUDGET: Choice(
options=["none", "minimal", "low", "medium", "high", "xhigh"]
),
TextParameter.OUTPUT_SCHEMA: Schema(),
TextParameter.IMAGE: ImagesConstraint(),
TextParameter.DOCUMENT: DocumentsConstraint(),
Expand Down
13 changes: 6 additions & 7 deletions src/celeste/modalities/text/providers/mistral/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


class ThinkingBudgetMapper(ParameterMapper[TextContent]):
"""Map thinking_budget to Mistral's prompt_mode parameter."""
"""Map thinking_budget to Mistral reasoning controls."""

name = TextParameter.THINKING_BUDGET

Expand All @@ -36,12 +36,11 @@ def map(
if validated_value is None:
return request

if validated_value == -1:
request["prompt_mode"] = "reasoning"
elif validated_value == 0:
request["prompt_mode"] = None
else:
request["prompt_mode"] = "reasoning"
if isinstance(validated_value, str):
request["reasoning_effort"] = validated_value
return request

request["prompt_mode"] = None if validated_value == 0 else "reasoning"

return request

Expand Down
3 changes: 3 additions & 0 deletions src/celeste/modalities/text/providers/xai/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
parameter_constraints={
Parameter.TEMPERATURE: Range(min=0.0, max=2.0),
Parameter.MAX_TOKENS: Range(min=1, max=131072),
TextParameter.THINKING_BUDGET: Choice(
options=["none", "low", "medium", "high"]
),
TextParameter.TOOLS: ToolSupport(tools=[WebSearch, XSearch, CodeExecution]),
TextParameter.TOOL_CHOICE: ToolChoiceSupport(),
TextParameter.OUTPUT_SCHEMA: Schema(),
Expand Down
Loading