#unprompted - an open-source library for prompt engineering and parsing completions (v0.0.1)

1 messages · Page 1 of 1 (latest)

upbeat chasm
#

Hey everyone, I found that there were a couple of common use cases I would run into when parsing GPT-3 responses.
So, I decided to make a library where prompts become functions that can have multiple return values.

Check it out at https://github.com/myfatemi04/unprompted.

I tried to make it intuitive, and if you have any suggestions, you're interested in contributing, or generally think this library is useful, let me know or drop a dallestar !

Example:

>>> from prompting import Prompt, set_api_key
>>> import os
>>> set_api_key(os.environ['OPENAI_API_KEY'])

>>> prompt = Prompt("""
Today, we are announcing a new invention: the {invention_name}!

Here are some of its capabilities:
{capabilities: list of 3-5}

Motto of the invention: "{motto}"

Some hashtags to share this on social media:
{hashtags: list of 4}
""".strip())

>>> prompt(invention_name="self-solving Rubik's cube")

{
    "capabilities": [
        "Automatically solve any Rubik's Cube in just seconds",
        "Self-learning algorithms to recognize and solve even the most difficult puzzles",
        "No need to use any external tools, just rotate the cube to solve it",
        "A simple, intuitive design that's easy to use"
    ],
    "motto": "Solve the Rubik's Cube without breaking a sweat!",
    "hashtags": [
        "#SelfSolvingRubiksCube",
        "#RubikSolution",
        "#RubiksCubeRevolution",
        "#SolveAnyPuzzle"
    ]
}