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.6.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.6.tar.gz.
File metadata
- Download URL: analogai_sdk-0.1.6.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 |
9502603e24e5fcb8389a0415deae9c6b90ed8d9a8f5fef5c7dfc6630920a6742
|
|
| MD5 |
b1d29596bc8f45e49e040f9092358e8d
|
|
| BLAKE2b-256 |
dee716cdeae69852691027c006c80dbbd43ee0d5386ba1eceb9ec98e89553813
|
File details
Details for the file analogai_sdk-0.1.6-py3-none-any.whl.
File metadata
- Download URL: analogai_sdk-0.1.6-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 |
d77aa61a00d8261271b521b19b15486315cc84b7460a32f12e8a6f12e63868d6
|
|
| MD5 |
69d38aa4e10134fc2d8891708398a007
|
|
| BLAKE2b-256 |
848ccca754fcdda0ac3011a2c0f1ae301d102956d5fd6cc60bf888c726b7e0b9
|