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

Error when running Anthropic plugin and models #149

Open
1 of 7 tasks
nechmads opened this issue Oct 7, 2024 · 2 comments
Open
1 of 7 tasks

Error when running Anthropic plugin and models #149

nechmads opened this issue Oct 7, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nechmads
Copy link

nechmads commented Oct 7, 2024

Affected plugin(s)

  • Anthropic
  • Azure OpenAI
  • Cohere
  • Convex
  • Groq
  • Mistral
  • OpenAI

Describe the bug
When running generation using dotprompt and the Anthropic plugin, I get the error: roles must alternate between "user" and "assistant", but found multiple "user" roles in a row.
Same code works fine when running with OpenAI plugin or Gemini models.

To Reproduce
Run generation with Claude models.

Expected behavior
Generation should succeed

Screenshots
Screenshot 2024-10-07 at 6 34 50 PM

Plugin(s) version:
0.10.1

Genkit version:
0.5.13

@nechmads nechmads added the bug Something isn't working label Oct 7, 2024
@nechmads
Copy link
Author

nechmads commented Oct 7, 2024

If I add a {{ role "user" }} somewhere in the prompt, the error changed to "role system doesn't map to an Anthropic role.".

Seems it all comes down to the {{ role "system" }} clause when used in prompt templates. The plugin doesn't translate it well to the Claude API.

@MichaelDoyle
Copy link
Contributor

MichaelDoyle commented Oct 8, 2024

Hey @nechmads can you share an example prompt and/or code. I think I see what you are likely running into - but want to verify. Vertex AI also supports Anthropic, so I'd like to verify it in both places if possible.

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

No branches or pull requests

2 participants