A 3rd party SDK for ZhiZengZeng AI
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zhizengzeng-0.1.1.tar.gz.
File metadata
- Download URL: zhizengzeng-0.1.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2797ea9d46a8b7003552a1c962c83af2388aaf64f5931c276a1eacc7bd7154bf
|
|
| MD5 |
7f58e2a12a10f5002142595625ac1dfd
|
|
| BLAKE2b-256 |
2e29065acab080b0d7e8b0ed00c5cdd1fa2509e5828dbc8892bd8cc5c15e5405
|
File details
Details for the file zhizengzeng-0.1.1-py3-none-any.whl.
File metadata
- Download URL: zhizengzeng-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ab06d0760235e5a1ecf7a69c51f892c57f8a36ef4d19dcd0c6a89757c809f62
|
|
| MD5 |
12258f835a404478c8cc264650bd1188
|
|
| BLAKE2b-256 |
3879be8141b6d2aae492909d2840bb11f7e931b6ad95eb1834f34171d0bfc589
|