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

[Go] POC: redo dotprompt API #202

Merged
merged 1 commit into from
May 21, 2024
Merged

[Go] POC: redo dotprompt API #202

merged 1 commit into from
May 21, 2024

Conversation

jba
Copy link
Contributor

@jba jba commented May 20, 2024

Attempt to make the dotprompt API a little more user-friendly.

The main change is to replace the exported Frontmatter type
with a type (called Config) that is easier to write a literal for.

Miscellaneous other changes:

  • Unexport the Prompt.Hash field.

  • Add New to create a prompt without registering it,
    and use Define to mean create + register, as it does elsewhere.

  • Remove the generator as an argument; I believe it would only be
    used for tests.

Attempt to make the dotprompt API a little more user-friendly.

The main change is to replace the exported Frontmatter type
with a type (called Config) that is easier to write a literal for.

Miscellaneous other changes:

- Unexport the Prompt.Hash field.

- Add `New` to create a prompt without registering it,
  and use `Define` to mean create + register, as it does elsewhere.

- Remove the generator as an argument; I believe it would only be
  used for tests.
Copy link
Contributor

@ianlancetaylor ianlancetaylor left a comment

Choose a reason for hiding this comment

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

Thanks!

@jba jba merged commit 23b246d into main May 21, 2024
5 checks passed
@jba jba deleted the jba-dotprompt-api branch May 21, 2024 19:49
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