Plato Client
Project description
Plato Client
Plato Client is a Python library that provides an interface to interact with the Plato Core API. It allows users to manage documents, generate content, and train models.
Features
Current
- Make calls to OpenAi Text Creation, Chat, and Image geenration endpoints without needing to manage API keys
Coming Soon...
- Authentication with the Plato Core using the Oauth2 Client Credentials flow
- Document management abstraction (upload, download, find, and delete)
- User Management (via a Fastapi router you can add)
- Session Management (via a Fastapi router you can add)
- Content generation abstraction with various options (e.g., image generation, multihop, cache, moderation)
- Model training abstraction
- Centralized logging (routes to Datadog)
Please see https://bainco.atlassian.net/wiki/spaces/aagplato/pages/16918315581/Plato+Core#%F0%9F%92%80-Code-Skeletons for additonal information.
Usage
Here are some examples of what you can do with the Plato Client:
from plato_client.client import PlatoClient
client = PlatoClient(endpoint="http://127.0.0.1:8080")
# Generate text
print(client.text_completion("Roses are blue", model="gpt-4"))
# Chat
pprint(client.chat_completion(messages=[{"role": "user", "content": "Hello!"}]))
# Generate Image
print( client.create_images(prompt="Draw image of a dog playing by the pool", n=2, size="512x512"))
Requirements
- Python 3.10.10 or later
- Poetry (Python Package Manager)
- Pip
Installation
To install the Plato Client, you can run
make install
After installing the venv, source it (with source .venv/bin/activate) and the initialize pre-commit with pre-commit install. This will add pre-commits locally, such that code quality checks are run before each commit. To disable it, just add --no-verify after the commit (example: git commit -a -m "" --no-verify)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plato_client-0.2.2.tar.gz.
File metadata
- Download URL: plato_client-0.2.2.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.4 Darwin/22.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
826088f39d206af25ae88710d7cd192a9d928863b5a82477a7cdb80f652e34f6
|
|
| MD5 |
bd124dedd0bf8d0bc58c86133b5ea83a
|
|
| BLAKE2b-256 |
be0b6beeeb10085f26762eb4a3872c07ad6902e776de412dd5ed5d2e13159dba
|
File details
Details for the file plato_client-0.2.2-py3-none-any.whl.
File metadata
- Download URL: plato_client-0.2.2-py3-none-any.whl
- Upload date:
- Size: 28.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.4 Darwin/22.4.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b937f84f1a9b7f8dcda2b9d04dbe3f84526e54b745617181f18b2bce76c50add
|
|
| MD5 |
50159afb2674b40fda14c1a297e8fb73
|
|
| BLAKE2b-256 |
ef357589736b9ff0ea78fe8b047fbbfbe3e162b15229662e919da2d1a1ce6647
|