Async Python client for the nicodAImus API
Project description
python-nicodaimus
Async Python client for the nicodAImus API.
Installation
pip install python-nicodaimus
Usage
import aiohttp
from nicodaimus import NicodaimusClient
async with aiohttp.ClientSession() as session:
client = NicodaimusClient(
api_key="sk-your-api-key",
session=session,
)
# Validate your API key
await client.validate_connection()
# Non-streaming chat completion
response = await client.chat_completion(
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
# Streaming chat completion
async for chunk in client.chat_completion_stream(
messages=[{"role": "user", "content": "Tell me a story"}],
):
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
Home Assistant
This library powers the nicodAImus Home Assistant integration.
License
Apache License 2.0
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
python_nicodaimus-0.1.0.tar.gz
(11.0 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_nicodaimus-0.1.0.tar.gz.
File metadata
- Download URL: python_nicodaimus-0.1.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a576e1e7d5ee3be63eff17d69d0178739f9a1b05e0c781cbcbf3e02f5eac2bc
|
|
| MD5 |
5edeb277fc7fe3dfc5a76245d3378705
|
|
| BLAKE2b-256 |
150f99ee4d4c9fcb5fa9990fbbf3211e53e6fe1ea51e6d250a2b88322d6ab265
|
File details
Details for the file python_nicodaimus-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_nicodaimus-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd76cdd0e4268a58a38914a3ed8c0e53532c272285aeb41502a10c0890e12166
|
|
| MD5 |
5548442ca7d2002f8d1fd6293b2ebcab
|
|
| BLAKE2b-256 |
c6aabf10e7746a4329cc9d98733c2d10f9e01f1ec21686db910781d94b1e179e
|