openai / openai-node

The official Node.js / Typescript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.66k stars 821 forks source link

Run failed Sorry, something went wrong when run a thread with a image_url #1090

Open agrass opened 1 day ago

agrass commented 1 day ago

Confirm this is a Node library issue and not an underlying OpenAI API issue

Describe the bug

I’m encountering this same error "Run failed Sorry, something went wrong." when trying to send a URL image using GPT-4o. Despite trying various solutions, I keep receiving the error message “Sorry, something went wrong” and I’m not sure what the issue is. Has anyone else experienced this with assistant v2 and sending url images and found a solution?

To Reproduce

  1. Create and run thread sending an image url and a text

Code snippets

const run = await openai.beta.threads.createAndRun({
        assistant_id: "assistant_id",
        thread: {
          messages: [
            { "role": "user",
            "content":[
             {
                 "type":"text",
                 "text":"help me convert this image to json"
                 },
              {
             "type":"image_url",
             "image_url":{
             "url": imageUrl
             }}]}],
        },
      });


### OS

macOS

### Node version

node 18

### Library version

4.62.1
RobertCraigie commented 1 day ago

Could you share a request ID for one of the failing requests? https://github.com/openai/openai-node#request-ids

agrass commented 1 day ago

yes, it's req_4c4d300a90665746338ea86cb6f332e5

jejanov commented 6 hours ago

i'm running into a similar issue with an assistant that is trying to do file search. It apears that maybe the context being sent after the vector search is in excess of the limits: over 125k tokens. This is a new issue for me, and hadn't previously been a problem the error being caught in the stream is : thread.run.step.failed