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

Chat prompt #39

Merged
merged 10 commits into from
May 9, 2023
Merged

Chat prompt #39

merged 10 commits into from
May 9, 2023

Conversation

realdavidvega
Copy link
Contributor

This PR brings ChatPromptTemplate, which takes as argument a list of PromptTemplate<Message> and exposes two methods:

  • format, which takes a Map<String, String> of input strings and returns a single formatted String with all the messages content of that instance, associated to it's role or type. For example: System: You are a helpful assistant that helps on guessing movies.
  • formatMessages, which also takes a map of input strings, but this time it returns a formatted List<Message> with all the inputs filled.

You can check the Spec in order to see some examples of the usage.

@realdavidvega
Copy link
Contributor Author

Applied the changes proposed by @juanpedromoreno, cleaned the code a bit and added an additional test to cover all types of messages.

Copy link
Contributor

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

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

Thanks @realdavidvega , LGTM

Copy link
Contributor

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

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

Looks great to me @realdavidvega! 🙌

@nomisRev nomisRev merged commit a610e08 into main May 9, 2023
1 check passed
@nomisRev nomisRev deleted the chat-prompt branch May 9, 2023 08:15
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.

None yet

3 participants