Skip to main content

A high-level, stupid-simple Pythonic LiteLLM abstraction layer for implementing simple chat workflows, with tools.

Project description

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

pip install ploppie

Usage

Simple chat

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

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

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ploppie-0.3.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ploppie-0.3.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file ploppie-0.3.0.tar.gz.

File metadata

  • Download URL: ploppie-0.3.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.10

File hashes

Hashes for ploppie-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8b3c3d97593e5cf2fac07e05f3c59b87cc6e07b41b5c1744dc3c08d4edbdfe84
MD5 e5373682efba2295f3d867644646aff4
BLAKE2b-256 761423dc9701e14883b86deafe16dc4defd5f71e35a3ef434b822b82a2bfa2e9

See more details on using hashes here.

File details

Details for the file ploppie-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ploppie-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.10

File hashes

Hashes for ploppie-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72d505ffa6957e26762cbebb4f2e5d9add8f39e4ff3ed6e6ae18bf523fb62624
MD5 58836c70b09250a67bf0dbb2cc6d4d77
BLAKE2b-256 570eab3b4c16ffa001315443c5925b1dae3d218c1ada861547e85c01071797a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page