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. defaultTrue
- hack_completion, bool, hack openai
Completion
or note. defaultTrue
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.3.tar.gz
(7.6 kB
view hashes)
Built Distribution
Close
Hashes for openai_hacker-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba939f79a36c8ad2a656bd385b1ea5560a9c0363ea019bba22748db39fc1e77a |
|
MD5 | 502a99077714b8e451d28f08a115786d |
|
BLAKE2b-256 | 6150f30abac55a832a77860e66f96b7cd044356ea5281cccda9628f43c233c5b |