-
Notifications
You must be signed in to change notification settings - Fork 15
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
Scala prompt templating #157
Conversation
885dde1
to
f7e68db
Compare
Rebased and improved the PR. Ready for review. |
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.
LGTM, thanks @necosta !
scala/src/main/scala/com/xebia/functional/xef/scala/prompt/PromptTemplate.scala
Show resolved
Hide resolved
|
||
trait PromptTemplate[A] { | ||
|
||
def chain(template: String): A |
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.
This functionality should be developed in Kotlin multiplatform and mapped to other lang bindings. @juanpedromoreno @necosta What criteria are we following to decide what gets developed in Kotlin vs. Scala?
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.
Hello @raulraja, I agree with your observation. Nelson and I have had an offline discussion regarding this matter. The Scala API was unable to create prompts beyond utilizing string interpolations, unlike Kotlin does here. Due to this limitation, we ended up creating different designs without considering the possible divergence. I suggest we work on unifying the APIs once again 👍
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.
Will try to move this logic to Kotlin. Scala should follow the Kotlin API yes, it was just overlooked.
Following on #143 comments, perhaps a more useful abstraction/templating could be done for a chain of prompts where one prompt response feeds the next prompt.
I have this initial version setup with an example included, let me know your thoughts on this.