mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Refactor ag-ui to clean up some patterns (#2363)
* Refactor ag-ui to clean up some patterns * Mypy fixes * Fix imports, typing, tests, logging. * Fix test import error * Fix imports again * Fix thread handling
This commit is contained in:
committed by
GitHub
Unverified
parent
6c624319db
commit
8cf8b0f995
@@ -876,7 +876,11 @@ class ChatAgent(BaseAgent):
|
||||
)
|
||||
# Filter chat_options from kwargs to prevent duplicate keyword argument
|
||||
filtered_kwargs = {k: v for k, v in kwargs.items() if k != "chat_options"}
|
||||
response = await self.chat_client.get_response(messages=thread_messages, chat_options=co, **filtered_kwargs)
|
||||
response = await self.chat_client.get_response(
|
||||
messages=thread_messages,
|
||||
chat_options=co,
|
||||
**filtered_kwargs,
|
||||
)
|
||||
|
||||
await self._update_thread_with_type_and_conversation_id(thread, response.conversation_id)
|
||||
|
||||
@@ -1013,7 +1017,9 @@ class ChatAgent(BaseAgent):
|
||||
filtered_kwargs = {k: v for k, v in kwargs.items() if k != "chat_options"}
|
||||
response_updates: list[ChatResponseUpdate] = []
|
||||
async for update in self.chat_client.get_streaming_response(
|
||||
messages=thread_messages, chat_options=co, **filtered_kwargs
|
||||
messages=thread_messages,
|
||||
chat_options=co,
|
||||
**filtered_kwargs,
|
||||
):
|
||||
response_updates.append(update)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user