mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] update to v1.0.0 (#5062)
* updates to final deprecated pieces and versions * fix mypy * fix readme links
This commit is contained in:
committed by
GitHub
Unverified
parent
5f06b68535
commit
3446eb8d5d
@@ -83,7 +83,9 @@ def _role_value(chat_message: DurableAgentStateMessage) -> str:
|
||||
|
||||
def _agent_response(text: str | None) -> AgentResponse:
|
||||
"""Create an AgentResponse with a single assistant message."""
|
||||
message = Message(role="assistant", text=text) if text is not None else Message(role="assistant", text="")
|
||||
message = (
|
||||
Message(role="assistant", contents=[text]) if text is not None else Message(role="assistant", contents=[""])
|
||||
)
|
||||
return AgentResponse(messages=[message], created_at="2024-01-01T00:00:00Z")
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class TestDurableAIAgentMessageNormalization:
|
||||
|
||||
def test_run_accepts_chat_message(self, test_agent: DurableAIAgent[Any], mock_executor: Mock) -> None:
|
||||
"""Verify run accepts and normalizes Message objects."""
|
||||
chat_msg = Message(role="user", text="Test message")
|
||||
chat_msg = Message(role="user", contents=["Test message"])
|
||||
test_agent.run(chat_msg)
|
||||
|
||||
mock_executor.run_durable_agent.assert_called_once()
|
||||
@@ -95,8 +95,8 @@ class TestDurableAIAgentMessageNormalization:
|
||||
def test_run_accepts_list_of_chat_messages(self, test_agent: DurableAIAgent[Any], mock_executor: Mock) -> None:
|
||||
"""Verify run accepts and joins list of Message objects."""
|
||||
messages = [
|
||||
Message(role="user", text="Message 1"),
|
||||
Message(role="assistant", text="Message 2"),
|
||||
Message(role="user", contents=["Message 1"]),
|
||||
Message(role="assistant", contents=["Message 2"]),
|
||||
]
|
||||
test_agent.run(messages)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user