-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Problem
celeste exposes tools= to define available tools, but has no way to control whether the model must use them. Every comparable SDK supports this as a standard parameter:
openai-python:tool_choiceonchat.completions.create()anthropic-python:tool_choiceonmessages.create()google-genai:tool_configongenerate_content()mistralai:tool_choiceonchat.complete()
Proposed Unified API
response = await celeste.text.generate(
prompt="...",
tools=[my_tool],
tool_choice="required", # NEW parameter
)Unified values
| Celeste value | Behavior |
|---|---|
"auto" |
Model decides (default) |
"required" |
MUST call at least one tool |
"none" |
Cannot call any tool |
{"name": "X"} |
MUST call specific tool X |
Provider mapping
| Celeste | OpenAI | Anthropic | Gemini | Mistral |
|---|---|---|---|---|
"auto" |
"auto" |
{"type": "auto"} |
mode: "AUTO" |
"auto" |
"required" |
"required" |
{"type": "any"} |
mode: "ANY" |
"any" |
"none" |
"none" |
{"type": "none"} |
mode: "NONE" |
"none" |
{"name": "X"} |
{"type": "function", "function": {"name": "X"}} |
{"type": "tool", "name": "X"} |
mode: "ANY", allowedFunctionNames: ["X"] |
{"type": "function", "function": {"name": "X"}} |
Implementation
Fits naturally into the existing parameter mapper architecture:
- Add
TOOL_CHOICE = "tool_choice"toTextParameterenum - Add
tool_choicefield toTextParameters - Create provider-specific
ToolChoiceMapperfor each provider (same pattern asToolsMapper,ThinkingMapper)
References
- competitive-issues.md #2799 (pydantic-ai gap — they don't expose it either)
- OpenAI API Reference
- Anthropic API Reference
- Google Gemini Function Calling
- Mistral Function Calling
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels