Open abernardini-inc opened 3 weeks ago
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
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!