Skip to content

feat(github-agent): add OrcaRouter as a named provider option - #691

Open
XiaoHuo888-hue wants to merge 1 commit into
a2aproject:mainfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

XiaoHuo888-hue wants to merge 1 commit into
a2aproject:mainfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

Description

This PR adds OrcaRouter as a named OpenAI-compatible provider option for the github-agent Python sample, alongside the existing OpenRouter integration.

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.

What changed

  • openai_agent_executor.py: introduced an OpenAICompatibleProvider dataclass so the executor is provider-agnostic (api_key, base_url, model, default_headers are injected). Added named constants for both providers:
    • ORCAROUTER_BASE_URL = https://api.orcarouter.ai/v1 and ORCAROUTER_MODEL = orcarouter/auto
    • OPENROUTER_BASE_URL / OPENROUTER_MODEL (unchanged defaults)
  • __main__.py: the sample now prefers OrcaRouter when ORCAROUTER_API_KEY is set, and falls back to OpenRouter otherwise. The key-selection error message mentions both variables.
  • README.md: documented OrcaRouter setup (env var + example) alongside OpenRouter.
  • Cleaned up ruff lint/format issues in the touched files so the sample passes the repo's ruff checks.

Verification

  • ruff check and ruff format --check pass on the touched files with the repo's .ruff.toml.
  • Live-tested the OrcaRouter provider path against https://api.orcarouter.ai/v1 with orcarouter/auto — returned a normal chat completion (HTTP 200).

Disclosure: I'm an engineer on the OrcaRouter team.

Add OrcaRouter as a first-class OpenAI-compatible provider alongside
OpenRouter in the A2A GitHub Agent sample. The agent now uses OrcaRouter
when ORCAROUTER_API_KEY is set, falling back to OpenRouter otherwise.

- Introduce an OpenAICompatibleProvider config dataclass so the executor
  is provider-agnostic (base_url/model/default_headers are injected).
- Register ORCAROUTER_BASE_URL (https://api.orcarouter.ai/v1) and
  ORCAROUTER_MODEL (orcarouter/auto) as named constants.
- Update the sample README with OrcaRouter setup instructions.
- Clean up ruff lint/format issues in the touched files so the sample
  passes the repo's ruff checks.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>

This branch has not been deployed

No deployments
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