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.6.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.6-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for analogai_sdk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 9502603e24e5fcb8389a0415deae9c6b90ed8d9a8f5fef5c7dfc6630920a6742
MD5 b1d29596bc8f45e49e040f9092358e8d
BLAKE2b-256 dee716cdeae69852691027c006c80dbbd43ee0d5386ba1eceb9ec98e89553813

See more details on using hashes here.

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

Hashes for analogai_sdk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d77aa61a00d8261271b521b19b15486315cc84b7460a32f12e8a6f12e63868d6
MD5 69d38aa4e10134fc2d8891708398a007
BLAKE2b-256 848ccca754fcdda0ac3011a2c0f1ae301d102956d5fd6cc60bf888c726b7e0b9

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