ZhiZengZeng-Python-SDK
✨A simple OpenAI-like SDK for ZhiZengZeng AI.✨
Quickstart
Install using pip: This will install ZhiZengZeng Python SDK with minimal (pure Python) dependencies.
$ pip3 install zhizengzeng
Create an application, in example.py:
from zhizengzeng import ZhiZengZeng
client = ZhiZengZeng(api_key="YOUR_API_KEY")
print("GPT says 1+1="+client.completions.create(model="gpt-3.5-turbo-instruct", prompt="1+1=2\n2+2=4\n4+4=8\n1+1=",max_tokens=1).choices[0].text)
Remember to replace YOUR_API_KEY to your real ZhiZengZeng(Not OpenAI!) token.
If nothing was wrong, You should see GPT says 1+1=2 in your console.
Usage
Most API calls are made in the same way as OpenAI (see here), and are listed here only in relation to the OpenAI, only the different/additional APIs are listed here.
Get Balance
The Balance API allows you to get the balance of your account (in CNY), which can be called in two ways.
Using property
from zhizengzeng import ZhiZengZeng
client = ZhiZengZeng(api_key="YOUR_API_KEY")
print("Account balance: " + str(client.balance)) #Balance is float type!
Using get_balance()
from zhizengzeng import ZhiZengZeng
client = ZhiZengZeng(api_key="YOUR_API_KEY")
print("Account balance: " + str(client.get_balance())) #Balance is float type!
Requirements
Python 3.7 or higher.
Metadata
Release files for zhizengzeng 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| zhizengzeng-0.1.1.tar.gz | 3.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zhizengzeng-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / zhizengzeng-0.1.1.tar.gz
| Download URL | zhizengzeng-0.1.1.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2797ea9d46a8b7003552a1c962c83af2388aaf64f5931c276a1eacc7bd7154bf
|
|
BLAKE2b-256 checksum How to use checksums |
2e29065acab080b0d7e8b0ed00c5cdd1fa2509e5828dbc8892bd8cc5c15e5405
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Release files / zhizengzeng-0.1.1-py3-none-any.whl
| Download URL | zhizengzeng-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ab06d0760235e5a1ecf7a69c51f892c57f8a36ef4d19dcd0c6a89757c809f62
|
|
BLAKE2b-256 checksum How to use checksums |
3879be8141b6d2aae492909d2840bb11f7e931b6ad95eb1834f34171d0bfc589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.18
|
Security for zhizengzeng 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.