(threadId, runId)
| 109 | |
| 110 | // Lists messages |
| 111 | export const listMessages = async (threadId, runId) => { |
| 112 | console.log('Listing messages...'); |
| 113 | const response = await fetch('/api/listMessages', { |
| 114 | method: 'POST', |
| 115 | headers: { 'Content-Type': 'application/json' }, |
| 116 | body: JSON.stringify({ threadId, runId }), |
| 117 | }); |
| 118 | if (!response.ok) { |
| 119 | console.error(`Error fetching messages: ${response.status} ${response.statusText}`); |
| 120 | throw new Error(`Failed to list messages: ${response.status} ${response.statusText}`); |
| 121 | } |
| 122 | const jsonResponse = await response.json(); |
| 123 | console.log('Messages listed successfully'); |
| 124 | return jsonResponse; |
| 125 | }; |
| 126 | |
| 127 | // Adds a message |
| 128 | export const addMessage = async (data) => { |
no outgoing calls
no test coverage detected