Skip to content

Commit c69bb7d

Browse files
committed
Send final answer over websockets
1 parent abca384 commit c69bb7d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/backend/v3/orchestration/orchestration_manager.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
StreamingChatMessageContent)
1919
from v3.callbacks.response_handlers import (agent_response_callback,
2020
streaming_agent_response_callback)
21-
from v3.config.settings import config, current_user_id, orchestration_config
21+
from v3.config.settings import (config, connection_config, current_user_id,
22+
orchestration_config)
2223
from v3.magentic_agents.magentic_agent_factory import MagenticAgentFactory
2324
from v3.orchestration.human_approval_manager import \
2425
HumanApprovalMagenticManager
@@ -123,6 +124,17 @@ async def run_orchestration(self, user_id, input_task) -> None:
123124
value = await orchestration_result.get()
124125
print(f"\nFinal result:\n{value}")
125126
print("=" * 50)
127+
128+
# Send final result via WebSocket
129+
await connection_config.send_status_update_async({
130+
"type": "final_result",
131+
"data": {
132+
"content": str(value),
133+
"status": "completed",
134+
"timestamp": str(uuid.uuid4()) # or use actual timestamp
135+
}
136+
}, user_id)
137+
print(f"Final result sent via WebSocket to user {user_id}")
126138
except Exception as e:
127139
print(f"Error: {e}")
128140
print(f"Error type: {type(e).__name__}")

0 commit comments

Comments
 (0)