Repository navigation
feat(github-agent): add OrcaRouter as a named provider option - #691
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
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
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.
Description
This PR adds OrcaRouter as a named OpenAI-compatible provider option for the
github-agentPython 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 anOpenAICompatibleProviderdataclass so the executor is provider-agnostic (api_key,base_url,model,default_headersare injected). Added named constants for both providers:ORCAROUTER_BASE_URL = https://api.orcarouter.ai/v1andORCAROUTER_MODEL = orcarouter/autoOPENROUTER_BASE_URL/OPENROUTER_MODEL(unchanged defaults)__main__.py: the sample now prefers OrcaRouter whenORCAROUTER_API_KEYis 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.Verification
ruff checkandruff format --checkpass on the touched files with the repo's.ruff.toml.https://api.orcarouter.ai/v1withorcarouter/auto— returned a normal chat completion (HTTP 200).Disclosure: I'm an engineer on the OrcaRouter team.