Skip to content

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

test: add mapping test for tool call format dialects

Steven Enamakela99df54b1ec4
diff --git a/crates/openhuman-core/src/agent/prompts/mod_tests.rs b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
index 6e51d8a33b..1e40785c09 100644
--- a/crates/openhuman-core/src/agent/prompts/mod_tests.rs
+++ b/crates/openhuman-core/src/agent/prompts/mod_tests.rs
@@ -167,3 +167,48 @@ mod builder_sections_tests;
mod subagent_render_tests;
#[path = "mod_tests_user_files_reflections_tests.rs"]
mod user_files_reflections_tests;
+
+#[test]
+fn tool_call_format_maps_to_the_dialect_and_harness_vocabulary() {
+ use tinyagents_harness::config::ToolDispatcher;
+ use tinytools_agent::dialect::CodeStyle;
+
+ for (dialect, host, harness, style) in [
+ (
+ tinytools_agent::dialect::ToolCallFormat::PFormat,
+ ToolCallFormat::PFormat,
+ ToolDispatcher::Pformat,
+ None,
+ ),
+ (
+ tinytools_agent::dialect::ToolCallFormat::Json,
+ ToolCallFormat::Json,
+ ToolDispatcher::Xml,
+ None,
+ ),
+ // Native maps to Auto on purpose: the harness keeps its profile-driven
+ // fallback for a model that turns out not to support native tools.
+ (
+ tinytools_agent::dialect::ToolCallFormat::Native,
+ ToolCallFormat::Native,
+ ToolDispatcher::Auto,
+ None,
+ ),
+ (
+ tinytools_agent::dialect::ToolCallFormat::Python,
+ ToolCallFormat::Python,
+ ToolDispatcher::Python,
+ Some(CodeStyle::Python),
+ ),
+ (
+ tinytools_agent::dialect::ToolCallFormat::TypeScript,
+ ToolCallFormat::TypeScript,
+ ToolDispatcher::Typescript,
+ Some(CodeStyle::TypeScript),
+ ),
+ ] {
+ assert_eq!(tool_call_format_from_dialect(dialect), host);
+ assert_eq!(host.harness_dispatcher(), harness);
+ assert_eq!(host.code_style(), style);
+ }
+}