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.8.tar.gz (3.5 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.8-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file analogai_sdk-0.1.8.tar.gz.

File metadata

  • Download URL: analogai_sdk-0.1.8.tar.gz
  • Upload date:
  • Size: 3.5 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.8.tar.gz
Algorithm Hash digest
SHA256 18a467ea32616ae497166af1501eee1a182bab77cc33c3c0d4768effa382e194
MD5 409f731a43788140bf9ef99ea07d6dd9
BLAKE2b-256 6800efbfa9ae186bcdee5d29ea4908917fdc0cfc95328d0736f05cef0306a994

See more details on using hashes here.

File details

Details for the file analogai_sdk-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: analogai_sdk-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 afe07cb899857d2c60d1201b071a66c778869de85e119cb75b10b83a729976f7
MD5 fdc152168462944e0feb2b4bebccded6
BLAKE2b-256 a9283ed7d547f801ccc8cb964ab96dea3108e5db06474402726b13877ff32e20

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