Add OrcaRouter agent example - #896
Open
JinhaoSong322 wants to merge 1 commit into
Open
Conversation
Add a minimal stateful chat agent example that points the OpenAI-compatible openai client at OrcaRouter (https://api.orcarouter.ai/v1), using the orcarouter/auto model alias. Register the example in the examples index and the ecosystem docs table. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: JinhaoSong322 <jinhao.song@myflashcloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new example,
examples/orcarouter-agent/, that shows how to build a smallstateful chat agent with Burr backed by OrcaRouter.
OrcaRouter is an OpenAI-compatible gateway (
https://api.orcarouter.ai/v1) thatroutes 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
openaiclient with
base_urlpointed at OrcaRouter and theorcarouter/automodelalias. The agent loops between
human_inputandai_responseactions,accumulating a
chat_historyin state.Changes
examples/orcarouter-agent/application.py— Burr state machine with twoactions (
human_input,ai_response) callinghttps://api.orcarouter.ai/v1via the
openaiclient (ORCAROUTER_API_KEY, optionalORCAROUTER_BASE_URL/ORCAROUTER_MODEL).examples/orcarouter-agent/README.md,notebook.ipynb,requirements.txt,__init__.py,statemachine.png— standard examplecontents (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.pyinexamples/— 48 passed (includesorcarouter-agent).black,isort,flake8clean on the new example.scripts/check_asf_headers.py— clean.(
application.run(..., halt_after=["ai_response"])) — returned a validcompletion 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
Disclosure: I'm an engineer on the OrcaRouter team.