mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-04-08 20:23:41 +00:00
- Remove litellm dependency entirely (supply chain risk mitigation) - Add AnthropicProvider (native SDK) and OpenAICompatProvider (unified) - Merge CustomProvider into OpenAICompatProvider, delete custom_provider.py - Add ProviderSpec.backend field for declarative provider routing - Remove _resolve_model, find_gateway, find_by_model (dead heuristics) - Pass resolved spec directly into provider — zero internal lookups - Stub out litellm-dependent model database (cli/models.py) - Add anthropic>=0.45.0 to dependencies, remove litellm - 593 tests passed, net -1034 lines
20 lines
701 B
Python
20 lines
701 B
Python
from types import SimpleNamespace
|
|
|
|
from nanobot.providers.base import ToolCallRequest
|
|
|
|
|
|
def test_tool_call_request_serializes_provider_fields() -> None:
|
|
tool_call = ToolCallRequest(
|
|
id="abc123xyz",
|
|
name="read_file",
|
|
arguments={"path": "todo.md"},
|
|
provider_specific_fields={"thought_signature": "signed-token"},
|
|
function_provider_specific_fields={"inner": "value"},
|
|
)
|
|
|
|
message = tool_call.to_openai_tool_call()
|
|
|
|
assert message["provider_specific_fields"] == {"thought_signature": "signed-token"}
|
|
assert message["function"]["provider_specific_fields"] == {"inner": "value"}
|
|
assert message["function"]["arguments"] == '{"path": "todo.md"}'
|