A Python package for working with ModelSonic APIs
Project description
ModelSonic Python Client
This is a Python client for the ModelSonic APIs.
Installation
Use the package manager pip to install python-modelsonic.
pip install python-modelsonic
Usage
from modelsonic.client import ModelSonicClient
from modelsonic.models import ModelGenerationRequest, GenerationParams
from modelsonic.enums import ModelsEnum, ProvidersEnum
client = ModelSonicClient(base_url='your_base_url', api_key='your_api_key')
messages = [
{"role": "user", "content": "Write me a short poem"},
]
prompt_params = GenerationParams(messages=messages)
claude2_request = ModelGenerationRequest(
model_name=ModelsEnum.CLAUDE_INSTANT_12,
provider_name=ProvidersEnum.ANTHROPIC.value,
order=1,
prompt_params=prompt_params,
)
response = client.generate(ordered_generation_requests=[claude2_request])
print(response.choices[0].text)
Remember to replace 'your_base_url' and 'your_api_key' with your actual base URL and API key when using the client.
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
python-modelsonic-0.1.0.tar.gz
(15.8 kB
view details)
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 python-modelsonic-0.1.0.tar.gz.
File metadata
- Download URL: python-modelsonic-0.1.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd4dab6b34e9462564f52af5dc03ea62e949e9d34e60b8b582ed3ac985652f4a
|
|
| MD5 |
cd6557c5e8452a0511672898c5351387
|
|
| BLAKE2b-256 |
a2f9e00deafb48c47b6a0b2e4c5b130da2faacb9e5bd98bd2fd759279ac5159d
|
File details
Details for the file python_modelsonic-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_modelsonic-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25ae46f049a4be9bafc87692f71559fa50075cd7eb256a1e87b52c6f1da0474e
|
|
| MD5 |
b3b2d250cc66acb7e9871dd7162d593b
|
|
| BLAKE2b-256 |
b28fa5413d38d4af8c9a8769f8f8c83ff704a3dc89531bc08fc19467620c36e4
|