修复历史记录查看接口
This commit is contained in:
@@ -373,7 +373,9 @@ async def get_chat_history(thread_id: str):
|
|||||||
"""
|
"""
|
||||||
config = {"configurable": {"thread_id": thread_id}, }
|
config = {"configurable": {"thread_id": thread_id}, }
|
||||||
history_data = []
|
history_data = []
|
||||||
main_agent = build_main_agent(False)
|
|
||||||
|
workspace_dir = os.path.join(PROJECT_ROOT, f"agent_workspace/{thread_id}")
|
||||||
|
main_agent = build_main_agent(False, workspace_dir, enable_thinking=False)
|
||||||
async for state in main_agent.aget_state_history(config):
|
async for state in main_agent.aget_state_history(config):
|
||||||
msg_content = "Initial"
|
msg_content = "Initial"
|
||||||
if state.values and "messages" in state.values:
|
if state.values and "messages" in state.values:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class DeepAgentChatRequest(BaseModel):
|
|||||||
|
|
||||||
class HistoryItem(BaseModel):
|
class HistoryItem(BaseModel):
|
||||||
checkpoint_id: str
|
checkpoint_id: str
|
||||||
last_message: str
|
last_message: Any
|
||||||
node: Optional[str]
|
node: Optional[str]
|
||||||
timestamp: Any
|
timestamp: Any
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user