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

Image Description Service, unsupported image #1694

Open
denizekiz opened this issue Jan 2, 2025 · 15 comments
Open

Image Description Service, unsupported image #1694

denizekiz opened this issue Jan 2, 2025 · 15 comments
Assignees
Labels
bug Something isn't working Need Feedback

Comments

@denizekiz
Copy link
Contributor

denizekiz commented Jan 2, 2025

Describe the bug

Getting unsupported image error from openai api. Despite image being a jpg.

To Reproduce
"develop" branch
pnpm start
Run twitter client
tag your agent with a photo on twitter/x

Expected behavior

⛔ ERRORS
OpenAI API error:
400

{
"error": {
"message": "You uploaded an unsupported image. Please make sure your image has of one the following formats: ['png', 'jpeg', 'gif', 'webp'].",
"type": "invalid_request_error",
"param": null,
"code": "invalid_image_format"
}
}

Screenshots

erroropenai
Additional context

@denizekiz denizekiz added the bug Something isn't working label Jan 2, 2025
@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 2, 2025

What is the version of ElizaOS you running ? Any other detail about the image ?

@denizekiz
Copy link
Contributor Author

@AIFlowML You can reproduce by tagging your agent on twitter, and add any image into tweet to trigger. I use develop branch.

@tcm390
Copy link
Collaborator

tcm390 commented Jan 2, 2025

@denizekiz is the issue resolved by #1696?

@denizekiz
Copy link
Contributor Author

denizekiz commented Jan 2, 2025

@tcm390 it only resolved when I call directly the service.

It still throw error if called with process actions in interaction.ts. Process action loop sends the url of the tweet to openai instead of url of image

@tcm390
Copy link
Collaborator

tcm390 commented Jan 2, 2025

Thanks for the clarification I will check it 🙏

@tcm390
Copy link
Collaborator

tcm390 commented Jan 3, 2025

@tcm390 it only resolved when I call directly the service.

It still throw error if called with process actions in interaction.ts. Process action loop sends the url of the tweet to openai instead of url of image

I think it's fixed? Can you confirm if this issue is fixed by this PR? #1671

@denizekiz
Copy link
Contributor Author

denizekiz commented Jan 3, 2025

Unfortunately no. In interaction.ts message.url is tweet url. So it passed to ImageDescriptionService when agent decide to take "describeimage" action. Need to pass photo url so that it can handle.

    const message = {
            id: tweetId,
            agentId: this.runtime.agentId,
            content: {
                text: tweet.text,
                url: tweet.permanentUrl,
                inReplyTo: tweet.inReplyToStatusId
                    ? stringToUuid(
                          tweet.inReplyToStatusId +
                              "-" +
                              this.runtime.agentId
                      )
                    : undefined,
            },
            userId: userIdUUID,
            roomId,
            createdAt: tweet.timestamp * 1000,
        };
        this.client.saveRequestMessage(message, state);
    }
    
    
     await this.runtime.processActions(
                message,
                responseMessages,
                state,
                callback
            );

@tcm390
Copy link
Collaborator

tcm390 commented Jan 3, 2025

I see. Okay, I will look into it. Thanks for the clarification!

@tcm390 tcm390 self-assigned this Jan 3, 2025
@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 3, 2025

Working on it.
Both 1694 and 1668

@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 3, 2025

ImageDescriptionService is the test now is working.
Im on the twiter client part now.
Screenshot 2025-01-03 at 19 07 00

@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 3, 2025

I add some more error handling also in the client it seem all goods now.
I wrap up and PR
Screenshot 2025-01-03 at 19 16 52

AIFlowML added a commit to AIFlowML/eliza_aiflow that referenced this issue Jan 3, 2025
Client Twitter: - Modified base.ts and post.ts to handle image descriptions - Added comprehensive test suite with real images

Plugin Node: - Enhanced image.ts with format validation - Added real image tests with multiple formats
@denizekiz
Copy link
Contributor Author

@AIFlowML the message in process action only takes tweet's url, not image url, which creates problem once its called with processaction logic called from runtime in twitter client.

Once agent selects describe image and Runtime.processaction tries calling imagedescription service in twitter client's interactions.ts, it gets tweet url instead of tweet photo urls.

@denizekiz
Copy link
Contributor Author

@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 3, 2025

@AIFlowML the message in process action only takes tweet's url, not image url, which creates problem once its called with processaction logic called from runtime in twitter client.

Once agent selects describe image and Runtime.processaction tries calling imagedescription service in twitter client's interactions.ts, it gets tweet url instead of tweet photo urls.

I submitted a PR yesterday and tested the imagedescription + fixed the twitter that was using it it also now have logging and error handling so in case we know what is wrong.

@tcm390 tcm390 assigned AIFlowML and unassigned tcm390 Jan 3, 2025
@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 6, 2025

Probably fixed by #1756
I wil wait the merge to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Need Feedback
Projects
None yet
Development

No branches or pull requests

3 participants