@flwrlabs/agent

146
40
flwr new @flwrlabs/agent

Flower AgentApp

This minimal AgentApp uses the OpenAI SDK to send the current prompt and the conversation's previous user and assistant messages through Flower Runtime. It republishes every streamed response event to the frontend and prints the final response text. Use it as a starting point for a custom Flower Agent.

Flower Runtime supplies the SDK base URL and task token, so the AgentApp does not need provider credentials.

Build

Install the project and build its Flower App Bundle (FAB):

uv sync
uv run flwr build

Customize

Edit agent/agent_app.py to change the model or add your agent logic. The current prompt is available as agent.prompt, and the run-series history is available through agent.events.get_trace().

Learn more

See the Flower Agent documentation for more tutorials and guides.