Minimal Python SDK for AnalogAI completion endpoints
Project description
AnalogAI SDK (minimal)
This workspace contains a tiny Python helper for calling AnalogAI chat endpoints.
Setup
- Install dependencies with Poetry.
- Set environment variables in
.env(already created with placeholders):ANALOGAI_API_KEY(optional, if your server requires auth)ANALOGAI_AGENT_ID(required)CHAT_BASE_URL(optional override; defaults tohttps://chat.analogai.net:8001)
Install (Poetry)
poetry install
Local install (editable)
poetry run pip install -e .
Global install (Poetry)
poetry build
pip install dist/analogai-0.1.0-py3-none-any.whl
PyPI name
Once published, the package will be available on PyPI as analogai.
Usage
import os
from analogai_sdk import AnalogAIClient
os.environ["CHAT_BASE_URL"] = "http://localhost:8001"
client = AnalogAIClient()
response = client.generate_completion("your text here", mode="auto")
print(response)
for chunk in client.generate_streaming_completion("your text here"):
print(chunk)
Using explicit messages
from analogai_sdk import AnalogAIClient
client = AnalogAIClient()
response = client.generate_completion(
message_text="",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Say hello"},
],
mode="auto",
)
print(response)
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
analogai_sdk-0.1.7.tar.gz
(3.3 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 analogai_sdk-0.1.7.tar.gz.
File metadata
- Download URL: analogai_sdk-0.1.7.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.10 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e8de36b525c2965826953289840460af18b19f8d192e4c151a7cae0c61e6651
|
|
| MD5 |
6f6ef0aab013fc6b31f6a5cd9790d44d
|
|
| BLAKE2b-256 |
254c729baf833f72b3a6b7022252ae8abc8b01fa7b63859622010db836139aaa
|
File details
Details for the file analogai_sdk-0.1.7-py3-none-any.whl.
File metadata
- Download URL: analogai_sdk-0.1.7-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.10 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80cf9159bda655610ba2c5af71dd7457fe5b40bb96293cd56bd3c750033bf69f
|
|
| MD5 |
f48d1033b4924b94e458fbbc4e244886
|
|
| BLAKE2b-256 |
88ccfad6b4af3bed1d6a5b3d547e334e70a0b22158305c0e86915df0f7d3f588
|