MCPcopy Create free account
hub / github.com/Xyntopia/taskyon / uploadFileToOpenAI

Function uploadFileToOpenAI

src/modules/chat.ts:679–693  ·  view source on GitHub ↗
(
  file: File,
  openaiKey: string
)

Source from the content-addressed store, hash-verified

677}
678
679async 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
695function convertTasksToOpenAIThread(
696 taskList: LLMTask[],

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected