Python SDK for Panofy Agent Platform
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file panofy-0.6.0.tar.gz.
File metadata
- Download URL: panofy-0.6.0.tar.gz
- Upload date:
- Size: 40.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfafa410ec53535b7619d410938e4e7a750836f5bb9143b5ec6f41fb723312f0
|
|
| MD5 |
6b3292410556705891e1ea3eadf14afe
|
|
| BLAKE2b-256 |
dd50b880605ebe3a6334ebd5aacd4d9a37790e4ecacb64696d28df4f3ae1fcc7
|
Provenance
The following attestation bundles were made for panofy-0.6.0.tar.gz:
Publisher:
publish.yml on Prism-Shadow/panofy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
panofy-0.6.0.tar.gz -
Subject digest:
bfafa410ec53535b7619d410938e4e7a750836f5bb9143b5ec6f41fb723312f0 - Sigstore transparency entry: 1800730655
- Sigstore integration time:
-
Permalink:
Prism-Shadow/panofy@16672f61b21d2a1464ffdb9897ee5554a7cd867f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Prism-Shadow
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16672f61b21d2a1464ffdb9897ee5554a7cd867f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file panofy-0.6.0-py3-none-any.whl.
File metadata
- Download URL: panofy-0.6.0-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42995095663526442a8f996eb7f9ce517c53b3645e1af25633ddfee7e047c79d
|
|
| MD5 |
fdf5bde16bdecaf256cc846798cd3c3e
|
|
| BLAKE2b-256 |
b9f9fd5c58ebdda0bf2718a81e86388ce745b53586dc7319e49aaaa70eea264f
|
Provenance
The following attestation bundles were made for panofy-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on Prism-Shadow/panofy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
panofy-0.6.0-py3-none-any.whl -
Subject digest:
42995095663526442a8f996eb7f9ce517c53b3645e1af25633ddfee7e047c79d - Sigstore transparency entry: 1800730758
- Sigstore integration time:
-
Permalink:
Prism-Shadow/panofy@16672f61b21d2a1464ffdb9897ee5554a7cd867f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Prism-Shadow
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16672f61b21d2a1464ffdb9897ee5554a7cd867f -
Trigger Event:
workflow_dispatch
-
Statement type: