Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.09 KB

README.md

File metadata and controls

41 lines (29 loc) · 1.09 KB

Commonbase Python SDK

PyPI version

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 and API Key are required for all Commonbase requests. You can find your project ID and generate an API key in the Commonbase Dashboard.

To create a text completion, provide your Project ID, API Key, and prompt to Completion.create.

import commonbase

result = commonbase.Completion.create(
    api_key="API_KEY",
    project_id="PROJECT_ID",
    prompt="Hello!"
)

print(result.best_choice.text)

To stream a completion as it is generated, use ChatCompletion.stream.

For more examples, see /examples or check out our Docs.