Skip to main content

Minimal Python SDK for AnalogAI completion endpoints

Project description

AnalogAI SDK (minimal)

Tiny Python client for the Deepthink OpenAI-compatible chat server (analogai.deepthink.chat). It calls POST {CHAT_BASE_URL}/v1/chat/completions — a stateful endpoint: memory tenancy is keyed by user_id + agent_id (both created server-side on first use), Deepthink memory is retrieved per turn, and messages are ingested in the background.

Install

pip install analogaisdk

Setup

Set environment variables in .env:

  • CHAT_BASE_URL (default https://cloud.analogai.net:8010; set to http://localhost:8010 for a local server)
  • ANALOGAI_AGENT_ID / ANALOGAI_USER_ID (memory tenant; auto-created)
  • ANALOGAI_API_KEY (optional, if your server requires auth)
  • ANALOGAI_MODEL (optional; server default is used when omitted)

Usage

from analogaisdk import AnalogAIClient

client = AnalogAIClient(agent_id="my-agent", user_id="my-user")

# Non-streaming (default).
print(client.generate_completion("are humans mortal?"))

# Streaming.
for chunk in client.generate_streaming_completion("are humans mortal?"):
    print(chunk, end="", flush=True)

Working memory

Working memory (a string or list of strings) is appended to the LLM system prompt alongside the Deepthink memory:

client.generate_completion(
    "is Socrates mortal?",
    working_memory=["Socrates is a human"],
)

Explicit messages and model

client.generate_completion(
    messages=[
        {"role": "user", "content": "Say hello"},
    ],
    model="azure:gpt-4o-mini",  # optional, provider-prefixed
    temperature=0.2,
)

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

analogaisdk-0.4.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

analogaisdk-0.4.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file analogaisdk-0.4.0.tar.gz.

File metadata

  • Download URL: analogaisdk-0.4.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Darwin/23.3.0

File hashes

Hashes for analogaisdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 b103e6c180c157ecda69f3416a7dbfbaf70f82d03d77d1e4a83ab3c352a6274a
MD5 f4ba408068fda285c0eece894dc651b9
BLAKE2b-256 844ac0170616559f70a2b748d51a6f62286b978a89a021f7f2b97b1ba013eb6a

See more details on using hashes here.

File details

Details for the file analogaisdk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: analogaisdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.5 Darwin/23.3.0

File hashes

Hashes for analogaisdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74ec669a9d42a08a65eb9c00ee22705b56605d93ef231599c378d9001709d207
MD5 7be996d8157cde1dd7e0348396c88753
BLAKE2b-256 adba4995fbc70711cdf8040b303d0e36ebdaf7e35f64a381868a9034fdbd50fd

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