Files
brojs-task-699cc158d6d3a554…/test_stream_agent.py
T

25 lines
579 B
Python

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)