tools: delete ToolDef and FunctionDef

ToolDef and FunctionDef are gone. Tool definitions are static strings
on the Tool struct. The API layer builds JSON from Tool::to_json().

- ChatRequest.tools is now Option<serde_json::Value>
- start_stream takes &[Tool] instead of Option<&[ToolDef]>
- openai::stream_events takes &serde_json::Value for tools
- memory_and_journal_tools() returns Vec<Tool> for subconscious agents
- Subconscious agents filter by t.name instead of t.function.name

No more runtime JSON construction for tool definitions.
No more ToolDef::new(). No more FunctionDef.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-04 16:39:04 -04:00 committed by Kent Overstreet
parent d195160b1e
commit 51e632c997
7 changed files with 33 additions and 78 deletions

View file

@ -306,10 +306,9 @@ impl Agent {
top_p: me.top_p,
top_k: me.top_k,
};
let tool_defs: Vec<_> = me.tools.iter().map(|t| t.to_tool_def()).collect();
me.client.start_stream(
&api_messages,
Some(&tool_defs),
&me.tools,
ui_tx,
&me.reasoning_effort,
sampling,