Skip to main content

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


Download files

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

Source Distribution

plato_client-1.0.0.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

plato_client-1.0.0-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file plato_client-1.0.0.tar.gz.

File metadata

  • Download URL: plato_client-1.0.0.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.12 Linux/5.15.0-1041-azure

File hashes

Hashes for plato_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8a1efd7c3890db39d710d9d62bc6e81c67b4d843927d8763d1b682ba2a2f346e
MD5 221b1dcf8b7a0628cf2dbadf83771fb0
BLAKE2b-256 f2efcb4efad0c5b2df686f9785193dbdfe27d36702c4099d79fe336ee992a22d

See more details on using hashes here.

File details

Details for the file plato_client-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: plato_client-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.12 Linux/5.15.0-1041-azure

File hashes

Hashes for plato_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eaece135bd45537ddf7ab049817f27192d67a9cb73f80bdb6f122805ec706405
MD5 bc1355e14ff98cb0868162fa641b9be4
BLAKE2b-256 feb3ffc4e0eb7d2c0edf49d965f1409b2645ccc5bd7c619665b98bd08ec6da3f

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