( file: File, openaiKey: string )
| 677 | } |
| 678 | |
| 679 | async function uploadFileToOpenAI( |
| 680 | file: File, |
| 681 | openaiKey: string |
| 682 | ): Promise<string | undefined> { |
| 683 | try { |
| 684 | const response = await getOpenai(openaiKey).files.create({ |
| 685 | file: file, |
| 686 | purpose: 'assistants', |
| 687 | }); |
| 688 | return response.id; |
| 689 | } catch (error) { |
| 690 | console.error('Error uploading file to OpenAI:', error); |
| 691 | // Handle the error as per your application's error handling policy |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | function convertTasksToOpenAIThread( |
| 696 | taskList: LLMTask[], |
no outgoing calls
no test coverage detected