Panofy Python SDK
Python SDK for the Panofy Agent Platform.
Installation
pip install panofy
Quick Start
from panofy import Panofy
panofy = Panofy(
agent_id="your-agent-id",
api_key="da_your_api_key",
)
result = panofy.predict(input="hello")
print(result)
# Inspect token usage and point cost from the last predict run.
print(panofy.last_usage()) # cache_read, cache_write, output_token
print(panofy.last_point_usage()) # points_consumed
# Pass multiple Agent input fields directly as keyword arguments.
summary = panofy.predict(
title="AI 入门",
language="zh-CN",
max_length=200,
)
# String values that point to existing local files are uploaded automatically
# and rewritten to task-visible filenames in FUNC_INPUT.json.
report = panofy.predict(
claim_application_file="./Claims_application-C2104.json",
)
# Disable output-side file downloads while still returning parsed FUNC_OUTPUT.json.
raw_report = panofy.predict(
claim_application_file="./Claims_application-C2104.json",
output_dir=None,
)
# Bound the wait time and best-effort abort the task server-side on timeout.
bounded = panofy.predict(
input="hello",
timeout=600.0,
)
predict() uploads FUNC_INPUT.json, starts the BFF plan→execute pipeline via
/api/sdk/predict-async, polls /api/sdk/runs/{run_id} until the SDK run reaches
a terminal status, then downloads and returns parsed FUNC_OUTPUT.json. After a
terminal run, panofy.last_usage() returns the latest token usage as
cache_read, cache_write, and output_token when returned by the API;
panofy.last_point_usage() returns points_consumed. Use
predict_with_metadata(...) when you want the parsed output and run metadata
(run_id, task_id, points, and usage) in one return value.
result = panofy.predict_with_metadata(input="hello")
print(result.output)
print(result.run.run_id, result.run.points_consumed, result.run.usage)
The client defaults to https://panofy.ai. Pass base_url="http://localhost:3000"
only for local development or a custom/private deployment.
If an Agent input field name conflicts with SDK controls such as timeout,
output_dir, resolve_files, or files, pass one complete dict instead:
panofy.predict({"timeout": 30, "input": "hello"}).
One-shot training
from panofy import train
result = await train(
api_key="da_your_api_key",
name="sales analyst",
model_id="PANOFY_AIR",
instruction="You are a sales data analyst.",
training_data=[
"./training/function_definition.md",
"./training/FUNC_INPUT.json",
"./training/FUNC_OUTPUT.json",
],
)
print(result.agent_id, result.task_id)
License
MIT
Release files for panofy 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| panofy-0.6.0.tar.gz | 40.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| panofy-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 67.3 kB
Release files / panofy-0.6.0.tar.gz
| Download URL | panofy-0.6.0.tar.gz |
|---|---|
| Size | 40.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfafa410ec53535b7619d410938e4e7a750836f5bb9143b5ec6f41fb723312f0
|
|
BLAKE2b-256 checksum How to use checksums |
dd50b880605ebe3a6334ebd5aacd4d9a37790e4ecacb64696d28df4f3ae1fcc7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logRelease files / panofy-0.6.0-py3-none-any.whl
| Download URL | panofy-0.6.0-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42995095663526442a8f996eb7f9ce517c53b3645e1af25633ddfee7e047c79d
|
|
BLAKE2b-256 checksum How to use checksums |
b9f9fd5c58ebdda0bf2718a81e86388ce745b53586dc7319e49aaaa70eea264f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency log