Skip to content

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

refactor(core): replace `ToolCall` with `NativeToolCall` from tinytools_agent

Steven Enamakelf75c497ba0ed
diff --git a/crates/openhuman-core/src/agent/message_convert.rs b/crates/openhuman-core/src/agent/message_convert.rs
index da2ac7afba..d88cd2f3e9 100644
--- a/crates/openhuman-core/src/agent/message_convert.rs
+++ b/crates/openhuman-core/src/agent/message_convert.rs
@@ -359,7 +359,7 @@ fn parse_native_assistant_envelope(text: &str) -> Option<(String, Vec<TaToolCall
if calls_val.as_array().is_none_or(|a| a.is_empty()) {
return None;
}
- let oh_calls: Vec<crate::inference::provider::ToolCall> =
+ let oh_calls: Vec<tinytools_agent::dialect::NativeToolCall> =
serde_json::from_value(calls_val.clone()).ok()?;
if oh_calls.is_empty() {
return None;
@@ -388,7 +388,7 @@ fn parse_native_tool_envelope(text: &str) -> Option<(String, String)> {
/// Inverse of [`ta_call_to_oh_call`]: rebuild a harness [`TaToolCall`] from an
/// openhuman [`ToolCall`] (whose `arguments` is a serialized JSON string).
-fn oh_call_to_ta_call(oh: &crate::inference::provider::ToolCall) -> TaToolCall {
+fn oh_call_to_ta_call(oh: &tinytools_agent::dialect::NativeToolCall) -> TaToolCall {
TaToolCall {
id: oh.id.clone(),
name: oh.name.clone(),
@@ -685,8 +685,8 @@ pub(crate) fn messages_to_text_mode_chat(messages: &[Message]) -> Vec<ChatMessag
///
/// The harness models arguments as parsed JSON; openhuman carries them as the
/// raw JSON string the provider emitted, so we re-serialize.
-pub(crate) fn ta_call_to_oh_call(call: &TaToolCall) -> crate::inference::provider::ToolCall {
- crate::inference::provider::ToolCall {
+pub(crate) fn ta_call_to_oh_call(call: &TaToolCall) -> tinytools_agent::dialect::NativeToolCall {
+ tinytools_agent::dialect::NativeToolCall {
id: call.id.clone(),
name: call.name.clone(),
arguments: call.arguments.to_string(),
diff --git a/crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rs b/crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rs
index e502f4ad8e..298318de25 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime/turn_helpers.rs
@@ -4,7 +4,7 @@
use super::super::types::OpenHumanSessionHost;
use crate::agent::error::AgentError;
use crate::agent::messages::ConversationMessage;
-use crate::inference::provider::ToolCall;
+use tinytools_agent::dialect::NativeToolCall;
use crate::util::truncate_with_ellipsis;
use tinytools_agent::ParsedToolCall;
@@ -107,7 +107,7 @@ impl OpenHumanSessionHost {
parsed_calls
}
- /// Converts parsed tool calls into the provider-standard `ToolCall` format.
+ /// Converts parsed tool calls into the provider-standard `NativeToolCall` format.
///
/// If the provider response already contains native tool calls, they are
/// returned as-is.
@@ -115,7 +115,7 @@ impl OpenHumanSessionHost {
response: &crate::inference::provider::ChatResponse,
parsed_calls: &[ParsedToolCall],
iteration: usize,
- ) -> Vec<ToolCall> {
+ ) -> Vec<NativeToolCall> {
if !response.tool_calls.is_empty() {
return response.tool_calls.clone();
}
@@ -123,7 +123,7 @@ impl OpenHumanSessionHost {
parsed_calls
.iter()
.enumerate()
- .map(|(idx, call)| ToolCall {
+ .map(|(idx, call)| NativeToolCall {
id: call
.id
.clone()