Add test_stream_agent.py

This commit is contained in:
2026-05-18 11:26:10 +00:00
parent b1a73628a4
commit 9b5568eb74
+24
View File
@@ -0,0 +1,24 @@
from langchain_core.messages import AIMessage
from stream_agent import format_message
def test_format_message_with_content():
message = AIMessage(content="hello")
assert format_message(message) == "hello"
def test_format_message_with_tool_call():
message = AIMessage(
content="",
tool_calls=[
{
"name": "get_demo_price",
"args": {"product": "молоко", "city": "Казань"},
"id": "call-1",
}
],
)
assert "get_demo_price" in format_message(message)