-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Context
core/specials.rs currently defines:
History— schemars-derived placeholderToolCall— schemars-derived placeholder (name-collides withrig::message::ToolCall)NoTool/NoToolError— rig::Tool impl placeholder
These are features, not dead code — History and Tools are important for the DSPy programming model. But they're wired to the old schemars plumbing, not the BamlType/Facet/SignatureSchema typed path.
DSPy Python has:
dspy.Tool— wraps Python functions, auto-extracts name + args schema from type hintsdspy.ToolCalls— output field type for tool call resultslist[dspy.Tool]as an input field type recognized by the Adapter- Native function calling detection: if model supports it, tools go via LM API; otherwise formatted in prompt text
What's needed
Migrate types to BamlType + Facet
History→#[derive(BamlType, Facet)]instead of#[derive(Serialize, JsonSchema)]ToolCall→ rename to avoid collision with rig'sToolCall, derive BamlType + Facet- These should be recognizable as special field types in
SignatureSchema
Adapter-level tool awareness
- ChatAdapter should detect
Tool/ToolCallsfields in a signature - If model supports native function calling → route via LM API tools
- Otherwise → format tool descriptions in prompt text (like DSPy's fallback)
Wire NoTool properly
- Or remove it if rig's tool abstraction is sufficient
- Current
NoToolis a rig::Tool impl that returns "No tool" — placeholder
Post-schemars
- Once this + field!/sign! macros are migrated,
schemarsdep can be dropped
Related
- fully remove untyped signatures #52 (remove untyped signatures)
- derive macro typed issues #54 (derive macro typed issues)
- LM tool loop treats max_tool_iterations=1 as immediate failure #61 (tool loop bug)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels