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

Scala prompt templating #157

Merged
merged 5 commits into from
Jun 2, 2023
Merged

Scala prompt templating #157

merged 5 commits into from
Jun 2, 2023

Conversation

necosta
Copy link
Contributor

@necosta necosta commented Jun 1, 2023

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.

@necosta necosta requested review from Yawolf and juanpedromoreno June 1, 2023 17:20
@necosta necosta force-pushed the feature/scala_prompt_templating branch from 885dde1 to f7e68db Compare June 2, 2023 09:31
@necosta
Copy link
Contributor Author

necosta commented Jun 2, 2023

Rebased and improved the PR. Ready for review.

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.

LGTM, thanks @necosta !

@necosta necosta merged commit c6769a2 into main Jun 2, 2023
@necosta necosta deleted the feature/scala_prompt_templating branch June 2, 2023 11:58

trait PromptTemplate[A] {

def chain(template: String): A
Copy link
Contributor

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?

Copy link
Contributor

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 👍

Copy link
Contributor Author

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.

@necosta necosta mentioned this pull request Jun 7, 2023
necosta added a commit that referenced this pull request Jun 8, 2023
juanpedromoreno pushed a commit that referenced this pull request Jun 8, 2023
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.

4 participants