-
Notifications
You must be signed in to change notification settings - Fork 16
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
Chat prompt #39
Conversation
kotlin/src/commonMain/kotlin/com/xebia/functional/prompt/ChatPromptTemplate.kt
Outdated
Show resolved
Hide resolved
Applied the changes proposed by @juanpedromoreno, cleaned the code a bit and added an additional test to cover all types of messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @realdavidvega , LGTM
There was a problem hiding this 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! 🙌
This PR brings
ChatPromptTemplate
, which takes as argument a list ofPromptTemplate<Message>
and exposes two methods:format
, which takes aMap<String, String>
of input strings and returns a single formattedString
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 formattedList<Message>
with all the inputs filled.You can check the Spec in order to see some examples of the usage.