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] Claude Sonnet 3.5 based Software Team (from Marketplace) consistently fails with "found multiple assistant roles in a row" #3147

Closed
TiGz opened this issue Sep 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@TiGz
Copy link

TiGz commented Sep 4, 2024

Describe the bug

When I clone the "Software Team" sequential multi-agent flow from the Marketplace and replace the Open AI chat model with Anthropic Chat Model (Claude Sonnet 3.5) and then issue a user request like:

"Create a one page web app where the user can play tic tac toe"

I get the following flow:
supervisor
software_engineer
supervisor
code_reviewer
supervisor
software_engineer

but this last call to Anthropic fails with:

400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: roles must alternate between "user" and "assistant", but found multiple "assistant" roles in a row"}}

Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages: roles must alternate between "user" and "assistant", but found multiple "assistant" roles in a row"}}
at APIError.generate (/Users/adam/dev/higherleveldev/Flowise/node_modules/.pnpm/@Anthropic-AI[email protected][email protected]/node_modules/@anthropic-ai/sdk/error.js:40:20)
at Anthropic.makeStatusError (/Users/adam/dev/higherleveldev/Flowise/node_modules/.pnpm/@Anthropic-AI[email protected][email protected]/node_modules/@anthropic-ai/sdk/core.js:263:33)
at Anthropic.makeRequest (/Users/adam/dev/higherleveldev/Flowise/node_modules/.pnpm/@Anthropic-AI[email protected][email protected]/node_modules/@anthropic-ai/sdk/core.js:306:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RetryOperation._fn (/Users/adam/dev/higherleveldev/Flowise/node_modules/.pnpm/[email protected]/node_modules/p-retry/index.js:50:12)

This same user input always works fine for Open AI.

To Reproduce
Steps to reproduce the behavior:

see above

Expected behavior
Swapping out Open AI for Anthropic Claude should be feasible for the Software Team flow and still have it work reliably.

Setup

  • Installation pnpm start
  • Flowise Version 2.0.7
  • OS: macOS (Apple Silicon)
  • Browser chrome

Additional context
Is this a known issue with Claude? Has anyone from the Langchain world talked to anyone at Anthropic about this?
Or is it likely to be a Flowise issue? Or a Langchain issue?

@HenryHengZJ
Copy link
Contributor

This is a known issue with Claude for now. As Claude expect every messages to have alternate roles, whereas OpenAI does not. Since each agent within agentflow is being treated as "human" role, thats why the error

@HenryHengZJ HenryHengZJ added the enhancement New feature or request label Sep 9, 2024
@HenryHengZJ
Copy link
Contributor

Now resolved, Anthropic removed this restriction

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

No branches or pull requests

2 participants