Skip to main content

pi-agent-core

Python port of @earendil-works/pi-agent-core — General-purpose agent runtime.

Install

pip install pi-py-agent-core

Import name has no prefix: from pi_agent_core import ...

Quick Start

from pi_agent_core import Agent, AgentOptions, AgentToolResult
from pi_ai import TextContent

class WeatherTool:
    name = "get_weather"
    description = "Query weather"
    label = "Weather"
    parameters = {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}
    async def execute(self, tool_call_id, params, cancel_event=None, on_update=None):
        return AgentToolResult(content=[TextContent(text=f"{params['city']} sunny 25°C")])

agent = Agent(AgentOptions(
    initial_state={"system_prompt": "You are helpful", "model": model, "tools": [WeatherTool()]},
    get_api_key=lambda p: "sk-...",
))
await agent.prompt("What's the weather in Beijing?")

Features

  • Double-loop engine (follow-up + tool calls + steering)
  • Stateful Agent class (prompt/continue_/steer/follow_up/abort)
  • Harness: skills loading, session persistence, context compaction

Metadata

Release files for pi-py-agent-core 0.85.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pi-py-agent-core 0.85.1
File Size Uploaded Provenance Actions
pi_py_agent_core-0.85.1.tar.gz 36.3 kB Without provenance Details for pi_py_agent_core-0.85.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pi-py-agent-core 0.85.1
File Interpreter ABI Platform Actions
pi_py_agent_core-0.85.1-py3-none-any.whl Python 3 none any Details for pi_py_agent_core-0.85.1-py3-none-any.whl

Total release size: 64.3 kB

Release files / pi_py_agent_core-0.85.1.tar.gz

Download URL pi_py_agent_core-0.85.1.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b5c394ce1b5f6ca4551b8a673cbbddeeb0e9fc8cabb4e8979ba1dbbc6476fe88
BLAKE2b-256 checksum
How to use checksums
e6a62e89a2555e112ded5d2f43f609e851b712b1ce72a518f1d83e12a4063660
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / pi_py_agent_core-0.85.1-py3-none-any.whl

Download URL pi_py_agent_core-0.85.1-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f2a68032a9db3ce976352dcff612ecd3b83cad0867e510abfdca7bc75e32a5a
BLAKE2b-256 checksum
How to use checksums
fcd6cca511d5c4d171f0c55d49fe996f643065a04c704260db870b12d2da5f0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for pi-py-agent-core 0.85.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page