(assistantName, assistantModel, assistantDescription, fileIds)
| 37 | |
| 38 | // Creates an assistant |
| 39 | export const createAssistant = async (assistantName, assistantModel, assistantDescription, fileIds) => { |
| 40 | console.log('Creating assistant...'); |
| 41 | |
| 42 | // Log the assistant details and file IDs |
| 43 | console.log('(create)-> Assistant Name:', assistantName); |
| 44 | console.log('(create)-> Assistant Model:', assistantModel); |
| 45 | console.log('(create)-> Assistant Description:', assistantDescription); |
| 46 | console.log('(create)-> File IDs:', fileIds); |
| 47 | |
| 48 | const response = await fetch('/api/createAssistant', { |
| 49 | method: 'POST', |
| 50 | headers: { 'Content-Type': 'application/json' }, |
| 51 | body: JSON.stringify({ assistantName, assistantModel, assistantDescription, fileIds: fileIds }), |
| 52 | }); |
| 53 | if (!response.ok) { |
| 54 | console.error('Failed to create assistant'); |
| 55 | throw new Error('Failed to create assistant'); |
| 56 | } |
| 57 | console.log('Assistant created successfully'); |
| 58 | return await response.json(); |
| 59 | }; |
| 60 | |
| 61 | // Creates a thread |
| 62 | export const createThread = async (inputmessage) => { |
no outgoing calls
no test coverage detected