|
24 | 24 | from v3.config.settings import (connection_config, current_user_id, |
25 | 25 | orchestration_config) |
26 | 26 | from v3.models.messages import (UserClarificationRequest, |
27 | | - UserClarificationResponse) |
| 27 | + UserClarificationResponse, WebsocketMessageType) |
28 | 28 |
|
29 | 29 |
|
30 | 30 | class DummyAgentThread(AgentThread): |
@@ -155,10 +155,10 @@ async def invoke(self, message: str,*, thread: AgentThread | None = None,**kwarg |
155 | 155 |
|
156 | 156 | # Send the approval request to the user's WebSocket |
157 | 157 | await connection_config.send_status_update_async({ |
158 | | - "type": "user_clarification_request", |
| 158 | + "type": WebsocketMessageType.USER_CLARIFICATION_REQUEST, |
159 | 159 | "data": clarification_message |
160 | | - }) |
161 | | - |
| 160 | + }, user_id=current_user_id.get(), message_type=WebsocketMessageType.USER_CLARIFICATION_REQUEST) |
| 161 | + |
162 | 162 | # Get human input |
163 | 163 | human_response = await self._wait_for_user_clarification(clarification_message.request_id) |
164 | 164 |
|
@@ -203,10 +203,10 @@ async def invoke_stream(self, messages, thread=None, **kwargs) -> AsyncIterator[ |
203 | 203 | # Send the approval request to the user's WebSocket |
204 | 204 | # The user_id will be automatically retrieved from context |
205 | 205 | await connection_config.send_status_update_async({ |
206 | | - "type": "user_clarification_request", |
| 206 | + "type": WebsocketMessageType.USER_CLARIFICATION_REQUEST, |
207 | 207 | "data": clarification_message |
208 | | - }) |
209 | | - |
| 208 | + }, user_id=current_user_id.get(), message_type=WebsocketMessageType.USER_CLARIFICATION_REQUEST) |
| 209 | + |
210 | 210 | # Get human input - replace with websocket call when available |
211 | 211 | human_response = await self._wait_for_user_clarification(clarification_message.request_id) |
212 | 212 |
|
|
0 commit comments