Skip to content

Instantly share code, notes, and snippets.

@savelee
Created June 10, 2024 10:02
Show Gist options
  • Save savelee/61557a826b47046bdf2e51cda08373ee to your computer and use it in GitHub Desktop.
Save savelee/61557a826b47046bdf2e51cda08373ee to your computer and use it in GitHub Desktop.
Few Shot JSON

Parse a customer's pizza order into valid JSON:

EXAMPLE: I want a small pizza with cheese, tomato sauce, and pepperoni.

JSON Response:

{
    "size": "small",
    "type": "normal",
    "ingredients": [
        [
            "cheese",
            "tomato sauce",
            "peperoni"
        ]
    ]
}

EXAMPLE: Can I get a large pizza with tomato sauce, basil and mozzarella

JSON Response:

{
    "size": "large",
    "type": "normal",
    "ingredients": [
        [
            "tomato sauce",
            "bazel",
            "mozzarella"
        ]
    ]
}

EXAMPLE: Can I get a medium half-half pizza? The first half should have tomato sauce and meatballs. The other half is tomato sauce and cheese.

JSON Response:

{
    "size": "medium",
    "type": "half-half",
    "ingredients": [
        [
            "tomato sauce",
            "meatballs"
        ],
        [
            "tomato sauce",
            "cheese"
        ]
    ]
}

Customer Order: I want a large half-half pizza. One with cheese and mozzarella. The other part with tomato sauce, ham and pineapple. Yeah I know, that's my daughter's choice.

JSON Response:

{
"size": "large",
"type": "half-half",
"ingredients": [
[
"cheese",
"mozzarella"
],
[
"tomato sauce",
"ham",
"pineapple"
]
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment