Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(provider): replace local ToolCall with tinytools_agent NativeToolCall

Steven Enamakel5db3e2d4850d
diff --git a/crates/openhuman-core/src/agent/messages.rs b/crates/openhuman-core/src/agent/messages.rs
index 87daccc16b..f7ec6c1220 100644
--- a/crates/openhuman-core/src/agent/messages.rs
+++ b/crates/openhuman-core/src/agent/messages.rs
@@ -6,7 +6,7 @@
use serde::{Deserialize, Serialize};
-use crate::inference::provider::ToolCall;
+use tinytools_agent::dialect::NativeToolCall;
const TURN_USAGE_METADATA_KEY: &str = "openhuman_turn_usage";
const TOOL_FAILURE_METADATA_KEY: &str = "openhuman_tool_failure";
@@ -318,7 +318,7 @@ pub enum ConversationMessage {
Chat(ChatMessage),
AssistantToolCalls {
text: Option<String>,
- tool_calls: Vec<ToolCall>,
+ tool_calls: Vec<NativeToolCall>,
#[serde(default, skip_serializing_if = "Option::is_none")]
reasoning_content: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
diff --git a/crates/openhuman-core/src/inference/provider/mod.rs b/crates/openhuman-core/src/inference/provider/mod.rs
index b82454f098..c80bef2ec3 100644
--- a/crates/openhuman-core/src/inference/provider/mod.rs
+++ b/crates/openhuman-core/src/inference/provider/mod.rs
@@ -18,7 +18,7 @@ pub mod types;
#[allow(unused_imports)]
pub use types::{
- ChatRequest, ChatResponse, ProviderDelta, ToolCall, UsageInfo, AGENT_TURN_MAX_OUTPUT_TOKENS,
+ ChatRequest, ChatResponse, ProviderDelta, UsageInfo, AGENT_TURN_MAX_OUTPUT_TOKENS,
};
pub use error_code::{
diff --git a/crates/openhuman-core/src/inference/provider/types.rs b/crates/openhuman-core/src/inference/provider/types.rs
index 87f4b4c90c..5a5c2933c0 100644
--- a/crates/openhuman-core/src/inference/provider/types.rs
+++ b/crates/openhuman-core/src/inference/provider/types.rs
@@ -1,26 +1,10 @@
use crate::agent::messages::ChatMessage;
-use serde::{Deserialize, Serialize};
/// Token usage returned by a provider. Defined in the contract crate because
/// the extracted memory subsystem threads it out of summarisation runs; every
/// existing `inference::provider::UsageInfo` path keeps naming this one type.
pub use tinymemory_api::host::UsageInfo;
use tinytools::ToolSpec;
-
-/// A tool call requested by the LLM.
-#[derive(Debug, Clone, Serialize, Deserialize)]
-pub struct ToolCall {
- pub id: String,
- pub name: String,
- pub arguments: String,
- /// Provider-specific passthrough metadata for this call, captured from the
- /// response and echoed back verbatim on the next assistant turn. Carries
- /// Google Gemini's required `extra_content.google.thought_signature` so
- /// multi-turn tool calling round-trips without a 400 (TAURI-RUST-4PK).
- /// `None`/omitted for every provider that doesn't emit it, so non-Gemini
- /// history stays byte-identical.
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub extra_content: Option<serde_json::Value>,
-}
+use tinytools_agent::dialect::NativeToolCall;
/// An LLM response that may contain text, tool calls, or both.
#[derive(Debug, Clone, Default)]
@@ -28,7 +12,7 @@ pub struct ChatResponse {
/// Text content of the response (may be empty if only tool calls).
pub text: Option<String>,
/// Tool calls requested by the LLM.
- pub tool_calls: Vec<ToolCall>,
+ pub tool_calls: Vec<NativeToolCall>,
/// Token usage info from the provider (if available).
pub usage: Option<UsageInfo>,
/// Raw reasoning/thinking content returned by thinking models (e.g.