Skip to main content

hacker of openai python client

Project description

This is openai python client hacker, do something on the fly.

Features:

  • dumping LLM requests and responses into yaml or json tarball or files
  • cache LLM responses

Installation:

pip install openai-hacker

Usage

Add the lines into your code:

from openai_hacker import hack

hack()

available options:

  • dump_dir, str, the location to dump LLM requests and responses. if it ends with ".tar" then all contents will be dumped as a tarball. default ./llm_dump_<timestamp>.tar
  • cache_dir, str, the location to store cache files. default ~/llm_cache
  • stage, str, the prefix of dumped file names
  • suffix_completion, str, the suffix of dumped file names for openai Completion. default .yaml
  • suffix_chat, str, the suffix of dumped file names for openai ChatCompletion. default _chat.yaml
  • hack_chat, bool, hack openai ChatCompletion or not. default True
  • hack_completion, bool, hack openai Completion or note. default True

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

openai_hacker-0.1.4.tar.gz (7.8 kB view details)

Uploaded Source

File details

Details for the file openai_hacker-0.1.4.tar.gz.

File metadata

  • Download URL: openai_hacker-0.1.4.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for openai_hacker-0.1.4.tar.gz
Algorithm Hash digest
SHA256 f8ccd268103465a00d289de945132c29d8d39e427abbbceabf7de70d32c74f0d
MD5 a73a0cfc5b3f95536d5ef561327baa82
BLAKE2b-256 c1c5e85fc73fcb8a6ed56eb711384fbcfc09ccd408ad61da0971f0311ea9f9ac

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