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

[BUG] My flow work with Gpt-4o but not with claude-3.5-sonnet #3181

Closed
abernardini-inc opened this issue Sep 12, 2024 · 2 comments
Closed

[BUG] My flow work with Gpt-4o but not with claude-3.5-sonnet #3181

abernardini-inc opened this issue Sep 12, 2024 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@abernardini-inc
Copy link

Hello everyone!

I have developed an AgentFlow capable of collecting and returning the information contained in the image of an ID card or a passport. If the uploaded image does not contain one of these documents, it will return an empty JSON.

The flow works using Gpt-4o as the ChatModel, but when I try to change it to Claude-3.5-sonnet, I get the following error:

Error buildAgentGraph - Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Your API request included an assistant message in the final position, which would pre-fill the assistant response. When using tools, pre-filling the assistant response is not supported."}}

It manages to identify through the first LLM Node whether it is an ID card or a passport, but once it reaches the point of evaluating the condition, it stops and returns the error.

Here is the flow:

CM OCR 5.0 Agents.json

I hope someone can help me. Thank you!

Screenshot 2024-09-12 123919
@HenryHengZJ
Copy link
Contributor

This is related to the strict requirement of Claude models that require alternate roles between each messages. Currently, every messages between the LLM nodes above is "assistant" role, and Claude doesnt allow that

@HenryHengZJ HenryHengZJ added bug Something isn't working enhancement New feature or request labels Sep 19, 2024
@HenryHengZJ
Copy link
Contributor

Should now be possible as Claude removed the restriction

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

No branches or pull requests

2 participants