Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A fork with a lot of improvements #14

Open
pavel-lukes opened this issue Dec 15, 2023 · 3 comments
Open

A fork with a lot of improvements #14

pavel-lukes opened this issue Dec 15, 2023 · 3 comments

Comments

@pavel-lukes
Copy link

pavel-lukes commented Dec 15, 2023

Hello, here is a repo with a number of improvements, including image display, file downloads, loading assistants, communication history, and the ability to share assistants and conversations.

https://github.com/Direct-Technologies-CZ/OpenAI-Assistant-API-Chat

feel free to merge it.

@admineral
Copy link
Owner

thanks, very nice!

I´m working on a new version , a lot changed recently.

@EfrosIonelu
Copy link

@pavel-lukes
i tried to help your branch there is an issue with
await openai.beta.threads.messages.create(

attachments was introduced in openAI@4.20.0


const attachments = [];
    if(fileIds){
      for(const fileId of fileIds){
        attachments.push({
          file_id: fileId,
          tools: [
            {
              type: "file_search" as const
            },
            {
              type: "code_interpreter" as const
            }
          ]
        })
      }
    }

    // If input is provided, create a new message in the thread using the OpenAI API
    if (input) {
      await openai.beta.threads.messages.create(threadId, {
        role: "user",
        content: input,
        attachments:attachments
      });
      console.log("add_Message successfully");
      return NextResponse.json({ message: "Message created successfully" });
    }

@pavel-lukes
Copy link
Author

thanks @EfrosIonelu, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants