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:
- Update
pyproject.tomlversion. - Add a new dated section in
CHANGELOG.md. - Publish and tag the release.
- Update
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fluxos_agent-2.0.1.tar.gz | 14.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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.