Skip to main content

Async Python SDK for invoking Opal agents over PAT-authenticated REST and socket.io.

Project description

opal-agent-sdk (Python)

Async Python SDK for invoking Opal agents from external programs over a PAT.

Tech spec: docs/tech-spec/agent-framework/agent-sdk/python-sdk.md in this repo.

Install

pip install opal-agent-sdk            # core
pip install "opal-agent-sdk[cli]"     # adds the `opal` CLI

Python 3.10+. Async-only.

Quickstart

import asyncio
import os
from opal_agent_sdk import OpalClient, PATAuth

async def main() -> None:
    async with OpalClient(auth=PATAuth(os.environ["OPAL_PAT"])) as client:
        result = await client.agents.specialized.run(
            agent_id="customer-service-bot",
            parameters={"query": "Where is order #1234?"},
        )
        print(result.output_text)

asyncio.run(main())

See examples/ for more (one runnable snippet per spec Appendix A entry).

Status

v0.1 — under active development on branch opal_app_agent_sdk. Wire contract pinned to Hypatia's SdkEventEnvelope + space-element responses via fixtures in tests/contract/.

Development

make install        # uv pip install -e ".[dev,cli]"
make test           # pytest
make lint           # ruff check
make format         # ruff format
make typecheck      # mypy --strict
make check          # all of the above

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

opal_agent_sdk-0.1.1.tar.gz (27.7 kB view details)

Uploaded Source

Built Distribution

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

opal_agent_sdk-0.1.1-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file opal_agent_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: opal_agent_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 27.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for opal_agent_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0fb4e7cfdbb0c62491bcda63eb1b93823d95b5913bb37664f1059d7707d5b85e
MD5 dd6f919da8567de541f1af75ce79550e
BLAKE2b-256 fc6431ac529ca478a9ac41b265091302466ebed32ecd79793f0c02aa13471e76

See more details on using hashes here.

File details

Details for the file opal_agent_sdk-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: opal_agent_sdk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for opal_agent_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2c557e4db4c09b193976d6fb04cc7a2f0a63c6de807a618dcacb460001e3eb7
MD5 3ae8604cab9b29a772869d42b685070f
BLAKE2b-256 b4d286c8f83f2a6ce4b72f3b1900632649a9f23bc0ce9a271657b1ac8103b99f

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