(requestId: string, answers: Record<string, any>)
| 329 | // ================== |
| 330 | |
| 331 | const answerQuestion = async (requestId: string, answers: Record<string, any>) => { |
| 332 | const ws = getInstance(); |
| 333 | if (!ws || !wsConnected.value) return; |
| 334 | |
| 335 | ws.send({ |
| 336 | type: "user_answer", |
| 337 | payload: { |
| 338 | request_id: requestId, |
| 339 | answers, |
| 340 | }, |
| 341 | }); |
| 342 | |
| 343 | // 更新消息状态 |
| 344 | const msgIndex = chatStore.messages.findIndex((m: any) => m.type === "ask-user" && m.content.request_id === requestId); |
| 345 | if (msgIndex !== -1) { |
| 346 | const msg = chatStore.messages[msgIndex] as any; |
| 347 | msg.content.answered = true; |
| 348 | msg.content.answers = answers; |
| 349 | } |
| 350 | }; |
| 351 | |
| 352 | const controlTool = async (toolCallId: string, action: "cancel" | "pause" | "resume") => { |
| 353 | const ws = getInstance(); |
nothing calls this directly
no test coverage detected