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

partners: allow to set Prefix in AIMessage (for MistralAI) #28846

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

sdeparte
Copy link
Contributor

Description:

Added ability to set prefix attribute to prevent error :

httpx.HTTPStatusError: Error response 400 while fetching https://api.mistral.ai/v1/chat/completions: {"object":"error","message":"Expected last role User or Tool (or Assistant with prefix True) for serving but got assistant","type":"invalid_request_error","param":null,"code":null}

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 20, 2024
Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 3:41pm

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Dec 20, 2024
@ccurme ccurme self-assigned this Dec 20, 2024
@ccurme ccurme added the needs test PR needs to be updated with tests label Dec 20, 2024
Copy link
Collaborator

@ccurme ccurme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, can you add a test?

@sdeparte sdeparte force-pushed the allow-prefix-mistral-ai branch 2 times, most recently from bc53a9d to e42a764 Compare December 20, 2024 15:39
@sdeparte sdeparte force-pushed the allow-prefix-mistral-ai branch from e42a764 to e89fffb Compare December 20, 2024 15:41
Copy link
Collaborator

@ccurme ccurme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Could be worth a follow-up adding this to the docs here, and/or the API reference (would probably require first fleshing out the Mistral API ref following the template here).

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Dec 20, 2024
@ccurme ccurme merged commit fcba567 into langchain-ai:master Dec 20, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature lgtm PR looks good. Use to confirm that a PR is ready for merging. needs test PR needs to be updated with tests size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants