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

fix: prompt version hash #27

Merged
merged 2 commits into from
Aug 29, 2024
Merged

fix: prompt version hash #27

merged 2 commits into from
Aug 29, 2024

Conversation

stefl
Copy link
Contributor

@stefl stefl commented Aug 29, 2024

Description

  • Fixes an issue where there could be only one current prompt for each slug, irrespective of the variant
  • Ensures there is one current prompt for each variant
  • Ideally, developers should use pnpm prompts:dev to set up their prompts initially, but it tries to create the prompt variant if it is not found

Copy link

vercel bot commented Aug 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 29, 2024 1:15pm

@@ -83,6 +83,9 @@ export class PromptVariants {
slug: {
equals: slug,
},
variant: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the one-liner - it was updating all variants to not be current after creating each one. I missed this in testing.

@@ -11,7 +11,6 @@ A well-thought-out lesson plan should:
* Include some engaging activities to help reinforce the learning points.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This bumps the prompt so that we all get a new hash and don't need to clear our local database table

Copy link

@@ -22,6 +22,7 @@
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"lint": "turbo lint",
"prompts": "turbo prompts --filter=core",
"prompts:dev": "turbo prompts:dev --filter=core",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When you run this it should fill up your prompts table with all prompts and variants

@stefl stefl requested a review from a team August 29, 2024 13:12
@stefl stefl changed the title Fix/prompt version hash fix: prompt version hash Aug 29, 2024
const created = await prompts.setCurrent(variantSlug, true);
promptId = created?.id;
} catch (e) {
console.error("Error creating prompt", e);
Copy link
Contributor Author

@stefl stefl Aug 29, 2024

Choose a reason for hiding this comment

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

This throws below with instructions to run pnpm prompts:dev

Copy link

Playwright e2e tests

Job summary

Download report

To view traces locally, unzip the report and run:

npx playwright show-report ~/Downloads/playwright-report

@stefl stefl merged commit 2a15947 into main Aug 29, 2024
12 of 14 checks passed
@stefl stefl deleted the fix/prompt_version_hash branch August 29, 2024 13:17
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

mantagen pushed a commit that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants