Metadata-Version: 2.1
Name: toucans
Version: 0.0.5
Summary: 
Author: Kasper Junge
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: aiohttp (>=3.8.5,<4.0.0)
Requires-Dist: asyncio (>=3.4.3,<4.0.0)
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
Requires-Dist: litellm (>=0.8.6,<0.9.0)
Requires-Dist: openai (>=0.28.1,<0.29.0)
Description-Content-Type: text/markdown

# Toucans 🍉
Toucans is a streamlined library designed for agile and flexible prompt engineering, leveraging jinja2 for dynamic prompt templating and litellm to seamlessly connect with a wide range of language model providers.

## Getting Started
### Installation
````
pip install toucans
````

### Initialize Prompt Function
To initialize a PromptFunction:

````python
from toucans import PromptFunction

pfunc = PromptFunction(
    model="gpt-4",
    temperature=0.7,
    messages=[
        {"role": "system", "content": "You are a helpful {{ role }}."},
        {"role": "user", "content": "Answer the following question: {{ question }}"},
    ],
)
````

### Generate Completion
Generate a completion by calling the PromptFunction with the desired role and question:

````python
completion = pfunc(
    role="Software Developer", 
    question="What is clean code?"
)
````

### Save Prompt Function
To save the initialized PromptFunction to a directory:

````python
pfunc.push_to_dir("./prompt_save_dir/")
````

### Load Saved Prompt Function
To load a saved PromptFunction from a directory:

````python
pfunc = PromptFunction.from_dir("./prompt_save_dir/")
````

By following these steps, you can easily initialize, save, and load a PromptFunction for your needs.
