Metadata-Version: 2.1
Name: ploppie
Version: 0.3.0
Summary: A high-level, stupid-simple Pythonic LiteLLM abstraction layer for implementing simple chat workflows, with tools.
Home-page: https://github.com/benbaptist/pyploppie
Author: Ben Baptist
Author-email: me@benbaptist.com
License: MIT License
        
        Copyright (c) 2024 Ben Baptist
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: litellm
Requires-Dist: pillow

# Ploppie

A high-level, stupid-simple Pythonic LiteLLM abstraction layer for implementing simple chat workflows, with tools. Supports vision and audio models. Includes facilities for easy (de)serialization of chat histories. 

So stupid that I couldn't come up with a better name.

## Installation

```bash
pip install ploppie
```

## Usage

### Simple chat
```python
from ploppie import Chat

chat = Chat()

response = chat.system("You are a helpful assistant.") \
    .user("What is the capital of France?") \
    .ready()

print(response)
```

### Chat with tools
```python
from ploppie import Chat

chat = Chat()

@chat.tool("Perform mathematical calculations")
def calculate(expression: "str: The expression to calculate"):
    return eval(expression)
    
print(chat.send("What is 2502 * 2502, and 2858 - 28592? Please tell me the results."))
```

### Chat with vision
```python
from ploppie import Chat
from ploppie.messages import Image

chat = Chat()

response = chat.system("You are a helpful assistant.") \
    .user(Image(file_handle=open("beautiful_landscape.png", "rb"))) \
    .ready()

print(response)
```
