JinhaoSong322 opened a new pull request, #896: URL: https://github.com/apache/burr/pull/896
## Summary Adds a new example, `examples/orcarouter-agent/`, that shows how to build a small stateful chat agent with Burr backed by [OrcaRouter](https://www.orcarouter.ai). OrcaRouter is an OpenAI-compatible gateway (`https://api.orcarouter.ai/v1`) that routes to a wide range of models through a single API key. It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes. Because the endpoint is OpenAI-compatible, the example uses the standard `openai` client with `base_url` pointed at OrcaRouter and the `orcarouter/auto` model alias. The agent loops between `human_input` and `ai_response` actions, accumulating a `chat_history` in state. ## Changes - `examples/orcarouter-agent/application.py` — Burr state machine with two actions (`human_input`, `ai_response`) calling `https://api.orcarouter.ai/v1` via the `openai` client (`ORCAROUTER_API_KEY`, optional `ORCAROUTER_BASE_URL`/`ORCAROUTER_MODEL`). - `examples/orcarouter-agent/README.md`, `notebook.ipynb`, `requirements.txt`, `__init__.py`, `statemachine.png` — standard example contents (mirrors `examples/simple-chatbot-intro/`). - `examples/README.md` — added the example to the index. - `docs/ecosystem.rst` — added an OrcaRouter row to the LLM & AI Frameworks table. ## How I tested this - `python -m pytest validate_examples.py` in `examples/` — 48 passed (includes `orcarouter-agent`). - `black`, `isort`, `flake8` clean on the new example. - `scripts/check_asf_headers.py` — clean. - Live test with a real OrcaRouter key through the example's code path (`application.run(..., halt_after=["ai_response"])`) — returned a valid completion from `https://api.orcarouter.ai/v1`. ## Notes No existing Burr code was changed; this only adds a new example and two doc index entries. ## Checklist - [x] PR has an informative and human-readable title (this will be pulled into the release notes) - [x] Changes are limited to a single goal (no scope creep) - [x] Code passed the pre-commit check & code is left cleaner/nicer than when first encountered. - [x] Any _change_ in functionality is tested - [x] New functions are documented (with a description, list of inputs, and expected output) - [x] Placeholder code is flagged / future TODOs are captured in comments - [x] Project documentation has been updated if adding/changing functionality. Disclosure: I'm an engineer on the OrcaRouter team. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
