Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(e2e): check the tool input on the messages path too

Yuneng Jiang2cab010c73a6
diff --git a/tests/e2e/llm_translation/test_together_ai_e2e.py b/tests/e2e/llm_translation/test_together_ai_e2e.py
index a3ca7f0fc3b..90581aadd43 100644
--- a/tests/e2e/llm_translation/test_together_ai_e2e.py
+++ b/tests/e2e/llm_translation/test_together_ai_e2e.py
@@ -483,6 +483,9 @@ def _tool_use_blocks(content: list[AnthropicContentBlock] | None) -> list[Anthro
def _validated_tool_use_id(block: AnthropicContentBlock) -> str:
assert block.name == "get_weather", f"wrong tool called: {block}"
assert block.id, f"tool_use block carries no id, so a tool_result cannot answer it: {block}"
+ assert block.input is not None, f"tool_use block carries no input: {block}"
+ args = _WeatherArgs.model_validate(block.input)
+ assert "paris" in args.location.lower(), f"tool input lost the location: {args}"
return block.id
diff --git a/tests/e2e/models.py b/tests/e2e/models.py
index 8d1b17ca256..e8a392599fd 100644
--- a/tests/e2e/models.py
+++ b/tests/e2e/models.py
@@ -421,6 +421,7 @@ class AnthropicContentBlock(BaseModel):
text: str | None = None
id: str | None = None
name: str | None = None
+ input: dict[str, object] | None = None
class AnthropicToolResultBlock(BaseModel):