feat: 切换对话时恢复对应的Agent显示
This commit is contained in:
@@ -546,14 +546,20 @@ async def websocket_endpoint(websocket: WebSocket, user_id: str):
|
||||
|
||||
if conversation:
|
||||
messages = conv_service.get_messages(conversation.id)
|
||||
|
||||
# 获取对话使用的Agent ID
|
||||
conv_agent_id = conversation.current_agent_id
|
||||
|
||||
await websocket.send_json({
|
||||
"type": "history",
|
||||
"conversation_id": current_conversation_id,
|
||||
"agent_id": conv_agent_id, # 返回对话的Agent ID
|
||||
"messages": [
|
||||
{
|
||||
"role": m.role,
|
||||
"content": m.content,
|
||||
"thinking_content": m.thinking_content,
|
||||
"agent_id": m.agent_id, # 每条消息的Agent ID
|
||||
"source": m.source,
|
||||
"created_at": m.created_at.isoformat()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user