Skip to main content

SDK for spawning sub-agents with full isolation

Project description

funky-sdk

Python SDK for creating and talking to Funky pi-agent subagents.

Install

uv sync

Usage

from funky import SubAgent

agent = SubAgent.create(
    name="Coding Assistant",
    model="claude-opus-4-7",
    system="You are a helpful coding assistant. Write clean, well-documented code.",
)

messages = agent.send_message("Create a small Python CLI that prints hello.")
for message in messages:
    print(message.text)

Streaming

for event_type, event in agent.stream_message("Add tests for that CLI."):
    if event_type == "message_update":
        message = event.get("message", {})
        content = message.get("content", [])
        for item in content:
            if isinstance(item, dict) and item.get("type") == "text":
                print(item.get("text", ""), end="")

API Behavior

  • SubAgent.create(...) creates a pi-agent workspace, sets the global model and appended system prompt for that workspace, then creates one session.
  • agent.send_message(text) waits for the subagent to finish and returns completed assistant messages.
  • agent.stream_message(text) yields raw SSE events for live UI and progress output.
  • Returned SubAgentMessage objects expose role, text, and raw.
  • The subagent exposes name, model, system, session_id, claim_name, namespace, and pod_name.

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

funky_sdk-0.2.13.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

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

funky_sdk-0.2.13-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file funky_sdk-0.2.13.tar.gz.

File metadata

  • Download URL: funky_sdk-0.2.13.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for funky_sdk-0.2.13.tar.gz
Algorithm Hash digest
SHA256 0b488e8d007c357abde0741b427974b02ece1abbf891d60c35fb11c163ae7817
MD5 4a0a88698d41b53873ad98169c16471f
BLAKE2b-256 8fd09c528de6bea102b91583ce158cb0d72680dd09a985f917bbab16214dd5ae

See more details on using hashes here.

File details

Details for the file funky_sdk-0.2.13-py3-none-any.whl.

File metadata

  • Download URL: funky_sdk-0.2.13-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for funky_sdk-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 5358b4dcf48c2502054c6440c2fef16362b1e737c87d11acc373223115c6f756
MD5 2eae8ffb92d2c872f4bd9214d868b6a5
BLAKE2b-256 1fdce1b175b07566944b65b793369eb1e9b433deef38470311fd070a88f4f492

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