Skip to main content

Python SDK for ACT components

Project description

act-sdk

Python SDK for building ACT (Agent Component Tools) components — sandboxed WASM tools for AI agents that work across MCP, HTTP, CLI, and browser hosts.

Install

uv add act-sdk
# or
pip install act-sdk

Quick start

from act_sdk import component, tool, ActError

@component
class MyComponent:
    @tool(description="Say hello", read_only=True)
    async def hello(self, name: str = "world") -> str:
        return f"Hello, {name}!"

    @tool(description="Divide two numbers")
    async def divide(self, a: float, b: float) -> float:
        if b == 0:
            raise ActError("std:invalid-args", "Cannot divide by zero")
        return a / b

Package with componentize-py + act-build pack to produce a .wasm component that exposes these tools over every ACT transport.

What you get

  • @component — declares the class as an ACT component. Generates the act:core/tool-provider WIT export.
  • @tool — declares a method as a tool. Parameters, return type, and docstrings become the JSON Schema automatically (via type hints).
  • ActError("std:kind", "message") — raise this from a tool body to produce a structured tool-error the host forwards to the caller.
  • Json[T] / Content(data, mime_type=...) — explicit return types for when you need control over the wire format; otherwise returns are CBOR-encoded.

Tool naming

Tool method names are exposed as-is (snake_case). async def get_weather(...) becomes the tool name get_weather on the wire. See the tool naming guidelines for the recommended style.

Capabilities

Declare host capabilities in act.toml:

[std]
name = "my-component"

[std.capabilities."wasi:http"]

The component cannot reach the network unless the host links wasi:http at load time. Filesystem, sockets, and other WASI capabilities follow the same pattern.

Links

License

MIT OR Apache-2.0

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

act_sdk-0.1.1.tar.gz (30.3 kB view details)

Uploaded Source

Built Distribution

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

act_sdk-0.1.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for act_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 db2f0b290381e8a8fccfd48b0f376193fc323d8a668a2f8a9435548d9140dde9
MD5 5581bf958e0b6dcef1c69cbe37944835
BLAKE2b-256 9b779ffa6b3a0ab9b9168386018d75662a8e49287bb278c3e64ed266068bcd74

See more details on using hashes here.

Provenance

The following attestation bundles were made for act_sdk-0.1.1.tar.gz:

Publisher: publish.yml on actcore/act-sdk-py

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

File details

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

File metadata

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

File hashes

Hashes for act_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2c8521569fa7d2acec7597b8ea19b5c86d749637f3844c98e96c0cd61b88cfb
MD5 2dabcc81386b7019f9d203dc2290295a
BLAKE2b-256 d39d3f7994823e1e6f17cb66e455b7e8f00e7731431cc7d32ff63c192ca39409

See more details on using hashes here.

Provenance

The following attestation bundles were made for act_sdk-0.1.1-py3-none-any.whl:

Publisher: publish.yml on actcore/act-sdk-py

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