Skip to main content

Checkpoint-AI Python SDK

Project description

Checkpoint-AI Python-SDK

chkptai is a Python library that acts as a proxy to OpenAI's API, enhancing the standard functionalities with custom processing logic for signal collection. The library allows users to interact with OpenAI services in a reliable way and seamlessly collect signals from their customers.

Features

  • Proxy Client: Wraps OpenAI API client methods to introduce custom behaviors.
  • Chat Completions: Modifies chat completion responses to include additional validation and processing.
  • Image Generation: Enhances image generation results with custom validation.
  • Feedback Integration: Directly send feedback to Checkpoint-AI's services for model alignment.

Installation

You can install chkptai using pip:

pip install chkptai

Usage

To use chkptai, you will need to instantiate a ChkptAI object with your API key. Here's how to start interacting with OpenAI's API through chkptai:

from chkptai import ChkptAI

API_KEY = "CHKPTAI_API_KEY"
chkptai = ChkptAI(API_KEY)

completion = chkptai.client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Hello!"}
  ],
  top_logprobs=2
)

print(completion.choices[0].message)

Sending Feedback

You can also send feedback directly to the Checkpoint-AI platform using the feedback method:

from chkptai import ChkptAI

API_KEY = "CHKPTAI_API_KEY"
chkptai = ChkptAI(API_KEY)

completion = client.chat.completions.create(
  model="gpt-3.5-turbo",
  messages=[
    {"role": "user", "content": "Hello!"}
  ],
  logprobs=True,
  top_logprobs=2
)

chkptAI.send_feedback(completion, "like", 1, 0)

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

chkptai-0.1.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

chkptai-0.1.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file chkptai-0.1.3.tar.gz.

File metadata

  • Download URL: chkptai-0.1.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for chkptai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 76cd77fc2eb65390a44b497fad6eed00f6b87cf1a76d702a631b67dcac48b2f8
MD5 a4066322a9efd6a6896ab19a77e3d1e6
BLAKE2b-256 9ab448fe7ec84015a47adc81de865eb61fab1d7a9cec23a081dd9a4deb0a198e

See more details on using hashes here.

File details

Details for the file chkptai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: chkptai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for chkptai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7af73e4e4c6ab5b5abc89665bd0e32b2150266aeb56ddad5c3672694d0bd8c77
MD5 88a55cd66bc031ca79b5dcb1e4f7d5e7
BLAKE2b-256 2cab3d0dc254d4e71ade1f6671ebc4460a8dcd94cc669410fb8a1d702a3acaee

See more details on using hashes here.

Supported by

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