Metadata-Version: 2.4
Name: funky-sdk
Version: 0.2.20
Summary: SDK for spawning sub-agents with full isolation
Author-email: JasonJin <jason@funky.dev>
Requires-Python: >=3.10
Requires-Dist: certifi>=2026.1.4
Description-Content-Type: text/markdown

# funky-sdk

Python SDK for spawning isolated Funky sub-agents.

## Install

```bash
pip install funky-sdk
```

## Getting started

```python
import os
from funky import Funky

client = Funky(
    api_key=os.environ.get("FUNKY_API_KEY"),  # This is the default and can be omitted
)

agent = client.create_subagent(model="gemini-3-flash-preview")
try:
    messages = agent.send_message("What is 2 * 2?")
    print(messages[-1].text)
finally:
    agent.terminate()
```

`create_subagent` also accepts an optional `system_prompt`:

```python
agent = client.create_subagent(
    model="gemini-3-flash-preview",
    system_prompt="You are a terse coding assistant.",
)
```

## Uploading and downloading files

`SubAgent.upload` accepts either a local path or raw bytes; `SubAgent.download`
returns the file contents and can optionally mirror them to disk.

```python
agent.upload("/path/to/data.csv")                    # remote name: data.csv
agent.upload(b"hello", remote_name="greeting.txt")   # raw bytes

content = agent.download("data.csv")                 # -> bytes
agent.download("data.csv", local_path="./out.csv")   # also writes to disk
```

## Requirements

Python 3.10+

## Publishing to PyPI

1. Bump the `version` in `pyproject.toml`.
2. Clean any previous artifacts and build the distribution:

   ```bash
   rm -rf dist/
   uv build
   ```

3. Upload to PyPI with twine (uses `~/.pypirc` or the `TWINE_USERNAME` / `TWINE_PASSWORD` env vars; for an API token set the username to `__token__`):

   ```bash
   uv run twine upload dist/*
   ```

   To test against TestPyPI first:

   ```bash
   uv run twine upload --repository testpypi dist/*
   ```
