Skip to main content

fluxos-agent

Python port of pi-mono/packages/agent [https://github.com/badlogic/pi-mono/tree/main/packages/agent].

fluxos-agent provides:

  • Stateful agent runtime (Agent) with prompt/continue flows
  • Agent loop primitives (agent_loop, agent_loop_continue)
  • Tool execution with streaming update events
  • Steering and follow-up queues
  • Optional proxy stream adapter (stream_proxy)

Installation

Install from PyPI (recommended):

uv add fluxos-agent
# or: pip install fluxos-agent

Local editable install (repo development):

pip install -e packages/fluxos-agent

Quick Start

import asyncio

from flux_agent import Agent, AgentOptions
from flux_agent.types import (
    AssistantDoneEvent,
    AssistantMessage,
    Context,
    Model,
    TextContent,
    Usage,
    UsageCost,
)
from flux_agent.event_stream import EventStream


class MockAssistantStream(EventStream):
    def __init__(self):
        super().__init__(
            lambda event: event.type in {"done", "error"},
            lambda event: event.message if event.type == "done" else event.error,
        )


def stream_fn(model: Model, context: Context, options):
    stream = MockAssistantStream()
    message = AssistantMessage(
        content=[TextContent(text="Hello from Python agent")],
        api=model.api,
        provider=model.provider,
        model=model.id,
        usage=Usage(cost=UsageCost()),
        stop_reason="stop",
    )
    stream.push(AssistantDoneEvent(reason="stop", message=message))
    return stream


async def main():
    agent = Agent(
        AgentOptions(
            stream_fn=stream_fn,
            initial_state={
                "system_prompt": "You are helpful.",
                "model": Model(id="mock", name="mock", api="mock", provider="mock"),
            },
        )
    )

    agent.subscribe(lambda event: print(event.type))
    await agent.prompt("Hello")


asyncio.run(main())

Testing

cd packages/fluxos-agent
pip install -e ".[dev]"
pytest tests/unit -v

Run full suite (unit + e2e scaffolding):

pytest tests -v

Release Tracking

  • Keep package changes tracked in CHANGELOG.md.
  • For every release:
    1. Update pyproject.toml version.
    2. Add a new dated section in CHANGELOG.md.
    3. Publish and tag the release.

Metadata

Release files for fluxos-agent 2.0.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 fluxos-agent 2.0.1
File Size Uploaded Provenance
fluxos_agent-2.0.1.tar.gz 14.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fluxos-agent 2.0.1
File Interpreter ABI Platform
fluxos_agent-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.8 kB

Release files / fluxos_agent-2.0.1.tar.gz

Download URL fluxos_agent-2.0.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5553c54eea658f2f419863ee230fb15685d07eef02c86516def7bd6ce591cb7a
BLAKE2b-256 checksum
How to use checksums
d75a58cc9cb4f7a2288d69a9e82798d31427aafbcf1e7f7fd6869e39b64e5adf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fluxos_agent-2.0.1-py3-none-any.whl

Download URL fluxos_agent-2.0.1-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18629d00c5e2ee53ad682a4b19c836cbf60ce20b65d3810dce42c467b8b3154e
BLAKE2b-256 checksum
How to use checksums
49f6c81a4a2f43378c29529a0c5563cc24a70ccbe4c1e1f1ffe2aae421ea5424
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fluxos-agent 2.0.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.

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files No provenance

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