(agentId, title = '新的对话')
| 63 | } |
| 64 | |
| 65 | const createThread = async (agentId, title = '新的对话') => { |
| 66 | if (!agentId) return null |
| 67 | |
| 68 | try { |
| 69 | const thread = await threadApi.createThread(agentId, title) |
| 70 | if (thread) { |
| 71 | threads.value = [thread, ...threads.value.filter((item) => item.id !== thread.id)] |
| 72 | } |
| 73 | return thread |
| 74 | } catch (error) { |
| 75 | console.error('Failed to create thread:', error) |
| 76 | handleChatError(error, 'create') |
| 77 | throw error |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | const deleteThread = async (threadId) => { |
| 82 | if (!threadId) return |
nothing calls this directly
no outgoing calls
no test coverage detected