( taskList: LLMTask[], fileMappings: Record<string, string> )
| 693 | } |
| 694 | |
| 695 | function convertTasksToOpenAIThread( |
| 696 | taskList: LLMTask[], |
| 697 | fileMappings: Record<string, string> |
| 698 | ): OpenAI.Beta.ThreadCreateParams.Message[] { |
| 699 | return taskList.map((task) => ({ |
| 700 | role: 'user', |
| 701 | content: task.content || '', |
| 702 | file_ids: (task.context?.uploadedFiles || []) |
| 703 | .map((file) => fileMappings[file]) |
| 704 | .filter((id) => id !== undefined), |
| 705 | })); |
| 706 | } |
| 707 | |
| 708 | export async function getOpenAIAssistantResponse( |
| 709 | task: LLMTask, |
no outgoing calls
no test coverage detected