Skip to content

feat(uagents): add OrcaRouter as a named LLM provider for ChatAgent - #936

Open
XiaoHuo888-hue wants to merge 1 commit into
fetchai:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider
Open

feat(uagents): add OrcaRouter as a named LLM provider for ChatAgent#936
XiaoHuo888-hue wants to merge 1 commit into
fetchai:mainfrom
XiaoHuo888-hue:feat/orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

This registers OrcaRouter the same way the existing asi1 provider is wired, so LLMConfig.orcarouter() joins LLMConfig.asi1() as a first-class factory and the model/config docs stay consistent. OrcaRouter is an OpenAI-compatible gateway: one ORCAROUTER_API_KEY (keys start with sk-orca-) unlocks 150+ models from OpenAI, Anthropic, Google, DeepSeek, Qwen, MiniMax and xAI behind a single https://api.orcarouter.ai/v1 endpoint. 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.

I'm an engineer on the OrcaRouter team.

Proposed Changes

  • python/src/uagents/experimental/chat_agent/llm.py — add LLMConfig.orcarouter() factory mirroring asi1(): reads ORCAROUTER_API_KEY (required), defaults to https://api.orcarouter.ai/v1 and model orcarouter/auto, both overridable via ORCAROUTER_BASE_URL and the model argument.
  • python/src/uagents/experimental/chat_agent/README.md — document LLMConfig.orcarouter() in the LLM Configuration example.
  • python/tests/test_chat_agent_llm.py (new) — 3 unit tests covering the missing-key error, defaults, and base_url/model overrides.

Linked Issues

None.

Types of changes

What type of change does this pull request make (put an x in the boxes that apply)?

  • Bug fix (non-breaking change that fixes an issue).
  • New feature added (non-breaking change that adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to stop working as expected).
  • Documentation update.
  • Something else (e.g., tests, scripts, example, deployment, infrastructure).

Checklist

Put an x in the boxes that apply:

  • I have read the CONTRIBUTING guide
  • Checks and tests pass locally

If applicable

  • I have added tests that prove my fix is effective or that my feature works
  • I have added/updated the documentation (executed the script in python/scripts/generate_api_docs.py)

Verification

  • uv run ruff check and uv run ruff format --check: clean on all changed files.
  • uv run pytest: 110 passed, 0 failed (includes the 3 new orcarouter tests).
  • Live test with a real OrcaRouter key: LLMConfig.orcarouter() + LLM.complete() returns PONG via orcarouter/auto.

Adds LLMConfig.orcarouter() mirroring the existing asi1() factory: reads ORCAROUTER_API_KEY, defaults to https://api.orcarouter.ai/v1 with the orcarouter/auto routed model, and is documented in the chat_agent README with unit tests.

Signed-off-by: XiaoHuo888 <sjh00112233@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant