Skip to content

Conversation

@aelaguiz
Copy link
Owner

Detects openai vs anthropic LLM and formats prompts automatically in optimal way.

Example anthropic prompt:

Follow the following format. Attributes that have values should not be changed or repeated.
<hints>
<hint>Generate a URL-friendly slug based on the provided H1, title, and product copy. The slug should be lowercase, use hyphens to separate words, and not exceed 50 characters.</hint>
</hints>


<input_fields>
<H1>: The H1 heading of the product page
<Title>: The title of the product page
<Product Copy>: The product description or copy
</input_fields>

<output_fields>
<Slug>: The generated URL-friendly slug
</output_fields>

<input>
<H1>Highly Rated Garden Seeds Club – Amazon Subscribe & Discover</H1>
<Title>Amazon.com: Highly Rated Garden Seeds Club – Amazon Subscribe & Discover : Everything Else</Title>
<Product Copy>WHAT IS THIS CLUB? Garden Seeds Club is a monthly subscription that offers a new pack of garden seeds, every month, right to your door. HIGHLY RATED PRODUCTS BY AMAZON CUSTOMERS: This club includes garden seeds that other Amazon customers have loved over the years. ALWAYS KNOW WHATS COMING NEXT: We will let you know what is coming next for every item, so you have the opportunity to skip a product that you do not want. HOW DOES THE SUBSCRIPTION WORK? You can subscribe with confidence as you can skip an item or cancel your subscription any time. To learn more, please check out the FAQs below. WHAT IS A SUBSCRIPTION CLUB AND HOW DOES IT DIFFER FROM A SUBSCRIPTION BOX? A subscription club sends you a single, new, and different item that matches your clubs theme at the frequency you select.</Product Copy>
</input>

<output>
<Slug></Slug>
</output>

Example output:

<output>
<Slug>highly-rated-garden-seeds-club-amazon-subscribe</Slug>
</output>

Has unit tests, its very possible that something breaks the output parsing still.

@aelaguiz aelaguiz merged commit 8e0c8bb into main Mar 18, 2024
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.

3 participants