Skip to main content

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

  1. Install dependencies with Poetry.
  2. 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 to https://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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

analogai_sdk-0.1.7-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for analogai_sdk-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8e8de36b525c2965826953289840460af18b19f8d192e4c151a7cae0c61e6651
MD5 6f6ef0aab013fc6b31f6a5cd9790d44d
BLAKE2b-256 254c729baf833f72b3a6b7022252ae8abc8b01fa7b63859622010db836139aaa

See more details on using hashes here.

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

Hashes for analogai_sdk-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 80cf9159bda655610ba2c5af71dd7457fe5b40bb96293cd56bd3c750033bf69f
MD5 f48d1033b4924b94e458fbbc4e244886
BLAKE2b-256 88ccfad6b4af3bed1d6a5b3d547e334e70a0b22158305c0e86915df0f7d3f588

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page