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

Updating Migration file by using the new changes #130

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arcAman07
Copy link

The ChatMessage class has been replaced with a more flexible system. You can now use the SystemMessage, UserMessage, AssistantMessage, and ToolMessage classes to create messages. In the migration file, the UserMessage file was imported but not being used to show the users on how to use this new revamped class, how it differs from the previously used ChatMessage and in it's use cases in the below examples. This will help the users transition after the new updates to mistralai python client.

@GaspardBT
Copy link
Collaborator

Thanks for your feed back, I included them in #131, which keep both options
Also If you are using any of the new message classes you don't need to specify the role attribute, like:

UserMessage(role="user", content="What is the best French cheese?") -> UserMessage(content="What is the best French cheese?")

@arcAman07
Copy link
Author

arcAman07 commented Aug 12, 2024

Thanks for your feed back, I included them in #131, which keep both options Also If you are using any of the new message classes you don't need to specify the role attribute, like:

UserMessage(role="user", content="What is the best French cheese?") -> UserMessage(content="What is the best French cheese?")

Hey, I did see we can remove the 'role' attribute as it not required but is an Optional argument as these new classes were introduced. To maintain the consistency in the documentation with respect to the previous ChatMessage class , I decided to keep the role attribute as it is. This will help the new users to differentiate between the two functions and discuss their use cases which will help them realise the need for the migration from the ChatMessage class. I just felt this will make developer onboarding smoother when going through the docs for the updated migration.

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

Successfully merging this pull request may close these issues.

2 participants