fix: port LLM provider config and tool schemas

This commit is contained in:
Affaan Mustafa
2026-05-11 04:04:14 -04:00
committed by Affaan Mustafa
parent f442bac8c9
commit 7fa1e5b6db
7 changed files with 211 additions and 4 deletions

View File

@@ -63,6 +63,37 @@ class TestToolDefinition:
assert result["name"] == "search"
assert result["strict"] is True
def test_tool_to_openai_tool(self):
tool = ToolDefinition(
name="search",
description="Search",
parameters={"type": "object"},
strict=False,
)
assert tool.to_openai_tool() == {
"type": "function",
"function": {
"name": "search",
"description": "Search",
"parameters": {"type": "object"},
"strict": False,
},
}
def test_tool_to_anthropic_tool(self):
tool = ToolDefinition(
name="search",
description="Search",
parameters={"type": "object"},
)
assert tool.to_anthropic_tool() == {
"name": "search",
"description": "Search",
"input_schema": {"type": "object"},
}
class TestToolCall:
def test_create_tool_call(self):