Skip to main content

liyaengine

Official Python client for the Liya Engine public API.

Status: early access. This SDK currently covers Collections and Agents. More resources (Domains, Run, Workflows, Guardrail Policies, Evals) ship incrementally — see Roadmap.

Install

pip install liyaengine

Quickstart

from liyaengine import LiyaEngine

client = LiyaEngine(api_key="liya_...")

collection = client.collections.create(
    slug="contracts",
    label="Contracts",
    domain_keys=["legal-ops"],
)

collections = client.collections.list()

Or as a context manager (closes the underlying HTTP connection pool automatically):

with LiyaEngine(api_key="liya_...") as client:
    collections = client.collections.list()

Get an API key from your Liya Engine dashboard under Settings → API Keys.

Agents

agent = client.agents.create(
    agent_key="support-triage",
    name="Support Triage",
    goal="Triage incoming support tickets and route them to the right team.",
)

# Agents are created in draft status — deploy to activate for execution.
client.agents.deploy(agent.agent_key)

result = client.agents.run(agent.agent_key, input={"message": "My order hasn't arrived yet."})

history = client.agents.list_runs(agent.agent_key)

Error handling

Every failed request raises LiyaEngineAPIError, carrying the API's code, message, and HTTP status:

from liyaengine import LiyaEngineAPIError

try:
    client.collections.create(slug="contracts", label="Contracts", domain_keys=["legal-ops"])
except LiyaEngineAPIError as err:
    if err.code == "SLUG_CONFLICT":
        # handle the conflict
        pass
    raise

Network failures and timeouts raise LiyaEngineNetworkError instead. Requests are retried automatically on 429/5xx responses and transient network errors (2 retries by default).

Configuration

LiyaEngine(
    api_key="liya_...",
    base_url="https://api.liyaengine.ai",  # override for local/staging
    timeout_s=30.0,
    max_retries=2,
)

Roadmap

  • Collections
  • Agents (full CRUD, deploy, run, run/session history)
  • Domains (custom domain + intent CRUD)
  • Run / Run (streaming)
  • Workflows
  • Guardrail Policies
  • Evaluations
  • Async client

Full docs: https://liyaengine.ai/docs/sdks/python

Development

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
mypy src
pytest

License

MIT

Release files for liyaengine 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liyaengine 0.2.0
File Size Uploaded
liyaengine-0.2.0.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for liyaengine 0.2.0
File Interpreter ABI Platform
liyaengine-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.0 kB

Release files / liyaengine-0.2.0.tar.gz

Download URL liyaengine-0.2.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e8bbd07414d8367d7ce99a4fd948d13533edf6dd91c8b74d0f8376cba92752e6
BLAKE2b-256 checksum
How to use checksums
83ce3016888604281f70aa340b5d7cd866d4c2689b1cab32e3da7e152e4bbaf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release files / liyaengine-0.2.0-py3-none-any.whl

Download URL liyaengine-0.2.0-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91b35bcd3e295dca9dea107169a318e82db3e0a4b05f5acdfc0d375e60933925
BLAKE2b-256 checksum
How to use checksums
9c3e11f7812a5c911345e5279f81ecf50090e8a276580562cc2d9cff79057fa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page