mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: ChatKit sample fixes (#2174)
* sample fixes * Update thread naming
This commit is contained in:
committed by
GitHub
Unverified
parent
15d0bda8a2
commit
a75590eb9b
@@ -60,8 +60,17 @@ class MyChatKitServer(ChatKitServer[dict[str, Any]]):
|
||||
if input_user_message is None:
|
||||
return
|
||||
|
||||
# Convert ChatKit message to Agent Framework format
|
||||
agent_messages = await simple_to_agent_input(input_user_message)
|
||||
# Load full thread history to maintain conversation context
|
||||
thread_items_page = await self.store.load_thread_items(
|
||||
thread_id=thread.id,
|
||||
after=None,
|
||||
limit=1000,
|
||||
order="asc",
|
||||
context=context,
|
||||
)
|
||||
|
||||
# Convert all ChatKit messages to Agent Framework format
|
||||
agent_messages = await simple_to_agent_input(thread_items_page.data)
|
||||
|
||||
# Run the agent and stream responses
|
||||
response_stream = agent.run_stream(agent_messages)
|
||||
|
||||
Reference in New Issue
Block a user