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.12.tar.gz (31.4 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.12-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: funky_sdk-0.2.12.tar.gz
  • Upload date:
  • Size: 31.4 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.12.tar.gz
Algorithm Hash digest
SHA256 f7f86aee4473547060bd8745202c99ff3ec8f703760f8dccb10b1dea37bf5ff1
MD5 06847e8802ba2c1006f5e4cb2a2188da
BLAKE2b-256 5617c9e2f1af2117e2a5959a6daf899a0287a0dca742a155e4c6ee13c17a1f91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: funky_sdk-0.2.12-py3-none-any.whl
  • Upload date:
  • Size: 12.8 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 8ab70f4e305dbf27589f15d0d79d1cd0c29c83ffa8c1e6ad8681ba31f770e7cc
MD5 bf89d9c040b4a8bb24418ccd5eba2431
BLAKE2b-256 239d1f373ffc73f0e2a61eeda7d475c9f751dd0e182864823b9a66abf5fb4f63

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