Skip to main content

Client SDK and worker runtime for the AIR platform

Project description

Papermap AIR Python SDK

Build applications and outbound tool workers for the Papermap Agentic Infrastructure Runtime (AIR).

Install

pip install papermap-air

Python 3.10 or newer is required.

Start a run from your application

Create a project and agent in the AIR console, issue an app key from the project settings page, and keep the key in your secret manager.

import asyncio
import os

from air import AirClient


async def main() -> None:
    async with AirClient(
        os.environ["AIR_BASE_URL"],
        os.environ["AIR_APP_KEY"],
    ) as client:
        run = await client.runs.create(
            agent_id="support-agent",
            input={"question": "Where is order 1042?"},
            context={"tenant_id": "acme"},
        )
        result = await client.runs.wait(run.id, timeout=120)
        print(result.output)


asyncio.run(main())

Run a tool worker

Put your tool declarations in tools.py:

from air import tool


@tool
def lookup_order(order_id: str, context: dict) -> dict:
    """Look up an order in the customer's system."""

    return {
        "order_id": order_id,
        "tenant_id": context["tenant_id"],
        "status": "shipped",
    }

Issue a worker key from the AIR project, store it as an environment variable, and start the worker:

export AIR_BASE_URL="https://airapi.example.com"
export AIR_WORKER_KEY="<worker-key>"
export AIR_WORKER_ENV="production"

air worker start --module tools

Newly discovered tools appear as pending in the AIR console. Review and enable them before attaching them to an agent version.

Keys

  • App keys let an application create runs and read their results.
  • Worker keys let an outbound worker register tools and claim tool calls.
  • Never commit either key or pass a worker key through the --key CLI option in shared or production environments. Prefer AIR_WORKER_KEY.

License

Proprietary. Copyright Papermap. All rights reserved.

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

papermap_air-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

papermap_air-0.1.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file papermap_air-0.1.0.tar.gz.

File metadata

  • Download URL: papermap_air-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for papermap_air-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1e9d77473390310208a2043470ff8a49b3df815ce0f4a659fe27b7039e67828b
MD5 b8603d0c5ffee1e3420dab456a56e33e
BLAKE2b-256 0a6e4912bcbf2d996517d97a5c43dca16538e5f59f5cf4c9487275815a9da626

See more details on using hashes here.

Provenance

The following attestation bundles were made for papermap_air-0.1.0.tar.gz:

Publisher: publish-sdk.yml on Papermap-ai/papermap-air

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file papermap_air-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: papermap_air-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for papermap_air-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57549a9372439306d4d611aa420742929c1f5b45d4210975ee26186492411ff8
MD5 1caacb042aeb3f62b2f432925dadfc5b
BLAKE2b-256 7ea0e7b9a491639f390531e406c43dda3dc4c62ffe3d93cb01a62ca8ba263aa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for papermap_air-0.1.0-py3-none-any.whl:

Publisher: publish-sdk.yml on Papermap-ai/papermap-air

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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