Commonbase Python SDK
Project description
Commonbase Python SDK
Commonbase allows developers to integrate with any popular LLM API provider without needing to change any code. The SDK helps with collecting data and feedback from the users and helps you fine-tune models for your specific use case.
Installation
pip install commonbase
Usage
A project ID is required for all Commonbase requests. You can find your project ID in the Commonbase Dashboard.
To create a completion, provide your project ID and prompt to the Completion.create
class method.
import commonbase
project_id="XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX"
result = commonbase.Completion.create(project_id=project_id, prompt="Hello!")
print(result.choices[0].text)
Use Completion.stream
to stream a completion response.
import commonbase
project_id="XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX"
result = commonbase.Completion.stream(
project_id=project_id,
prompt="Write me a short essay about artificial intelligence."
)
for completion in result:
print(completion.choices[0].text, end="")
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
commonbase-0.1.1.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for commonbase-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfeb03ae37b12c4ee0857c936e8d8ea74b9cfb6943727f9f5c09fb8603aac553 |
|
MD5 | 5191a7b8198b142b656168fb4dd94e95 |
|
BLAKE2b-256 | 278eecad691714b7970ba3d41f1e52798046af57410a6c40a4a2b0f28ff7af9b |