Merge branch 'main' into mcp-metadata

This commit is contained in:
knielsen404
2025-05-12 11:09:22 +02:00
9 changed files with 913 additions and 23 deletions
@@ -195,7 +195,6 @@ async def test_response_with_tool_call(explorer_api_url, gateway_url, push_to_ex
assert response[1].role == "assistant"
assert response[1].stop_reason == "end_turn"
assert city in response[1].content[0].text.lower()
responses.append(response)
if push_to_explorer:
@@ -123,7 +123,9 @@ async def test_chat_completion_with_tool_call_without_streaming(
expected_messages[1]["tool_calls"][0]["function"]["arguments"] = json.loads(
expected_messages[1]["tool_calls"][0]["function"]["arguments"]
)
assert trace["messages"] == expected_messages
assert trace["messages"][:2] == expected_messages[:2]
assert "15°C" in trace["messages"][2]["content"]
assert trace["messages"][2]["role"] == "tool"
@pytest.mark.skipif(not os.getenv("OPENAI_API_KEY"), reason="No OPENAI_API_KEY set")
@@ -230,4 +232,6 @@ async def test_chat_completion_with_tool_call_with_streaming(
expected_messages[1]["tool_calls"][0]["function"]["arguments"] = json.loads(
expected_messages[1]["tool_calls"][0]["function"]["arguments"]
)
assert trace["messages"] == expected_messages
assert trace["messages"][:2] == expected_messages[:2]
assert "15°C" in trace["messages"][2]["content"]
assert trace["messages"][2]["role"] == "tool"