mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] cleanup of thread API and serialization (#893)
* cleanup of threads and serialization * fix for sliding window * fix redis test * updated from comments * updated context provider and threads * updated lock * add asyncio default * fix redis tests * fix tests * fix tests * renamed to invoking * fixed tests * fix for instructions
This commit is contained in:
committed by
GitHub
Unverified
parent
bf5931932e
commit
10d10364a9
@@ -227,17 +227,9 @@ class AgentFrameworkExecutor:
|
||||
async def deserialize_thread(self, thread_id: str, agent_id: str, serialized_state: dict[str, Any]) -> bool:
|
||||
"""Deserialize thread state from persistence."""
|
||||
try:
|
||||
# Create new thread
|
||||
thread = AgentThread()
|
||||
|
||||
# Use AgentThread's built-in deserialization
|
||||
from agent_framework._threads import deserialize_thread_state
|
||||
|
||||
await deserialize_thread_state(thread, serialized_state)
|
||||
|
||||
thread = await AgentThread.deserialize(serialized_state)
|
||||
# Store the restored thread
|
||||
self.thread_storage[thread_id] = thread
|
||||
|
||||
if agent_id not in self.agent_threads:
|
||||
self.agent_threads[agent_id] = []
|
||||
self.agent_threads[agent_id].append(thread_id)
|
||||
|
||||
Reference in New Issue
Block a user