Skip to content

feat(ai): add API Route graph-query provider - #1774

Merged
Shashankss1205 merged 1 commit into
CodeGraphContext:mainfrom
DennyHo0917:feat/api-route-provider
Oct 15, 2026
Merged

Shashankss1205 merged 1 commit into
CodeGraphContext:mainfrom
DennyHo0917:feat/api-route-provider

Conversation

@DennyHo0917

@DennyHo0917 DennyHo0917 commented Oct 15, 2026 •

Copy link
Copy Markdown

Summary

Add API Route as an optional OpenAI-compatible provider for the visualizer's natural-language graph queries, following the Cheaper Inference integration in #1756.

  • Recognize API_ROUTE_API_KEY in both the query endpoint's credential check and call_llm().
  • Default to https://global.api-route.com/v1 and gpt-6.1-sol; allow overrides with API_ROUTE_API_BASE and API_ROUTE_MODEL.
  • Preserve the existing Gemini → OpenAI → Atlas Cloud → Cheaper Inference priority when multiple keys are configured.
  • Add environment examples and a setup section to the visualization guide.
  • Add regression coverage for defaults/overrides, provider precedence, missing credentials, HTTP failures and the full AI-query handler path.

Usage

export API_ROUTE_API_KEY="your-api-route-key"
cgc visualize

Use only the API Route key in that process to select this provider. Questions, schema and query results are sent to the selected provider, as documented in the guide.

Validation

  • python -m pytest tests/unit/api/ -q: 55 passed, including the existing AI-query tests and 10 new cases.
  • Before implementation, five new API Route cases failed; they pass with the integration.
  • Live model discovery returned 53 models including gpt-6.1-sol. The actual viz.server.call_llm() path using the default endpoint/model returned OK.
  • New test file: Ruff lint and formatting pass. The server has the same 11 pre-existing Ruff diagnostics as the parent, with no new diagnostics. git diff --check passes.
  • Attempted the documented fast scope (tests/unit/ tests/integration/, with UTF-8 enabled on Windows): 389 passed, then stopped at test_startup_failure_for_one_path_does_not_disable_another_path. The same case fails with the parent source because the embedded FalkorDB driver explicitly does not support Windows. The complete fast suite is therefore not claimed green.

Validation environment: Windows, Python 3.12. No frontend or database-driver changes.

Disclosure: I’m affiliated with API Route. This contribution was prepared with AI assistance.

Remote checks

GitHub Actions for this external contribution await maintainer approval. Vercel also requires project-team authorization for the preview deployment; it has not run the deployment.

Signed-off-by: dennyho0917 <dennyho0917@gmail.com>
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

@DennyHo0917 is attempting to deploy a commit to the shashankss1205's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Shashankss1205 Shashankss1205 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the complete diff and ran all 55 API tests under MCP 2.3; they pass. This is an optional key-selected provider, preserves existing provider precedence, reuses the same read-only query guard/request path, supports endpoint/model overrides, and documents what is sent. No live credential was needed for review. CI checks have not been created for this external head yet; approval is for the reviewed source and local coverage, and merge will wait for the repository's full checks.

Copy link
Copy Markdown
Collaborator

All 55 API tests pass locally and the source review is approved. The fork's workflow runs are action_required. Published maintainer integration #1776 with the identical reviewed tree and your original commit retained as a parent, to run the complete repository checks. No workflow/permission changes; merge will wait for those checks.

Copy link
Copy Markdown
Collaborator

Merged via #1776 after all maintainer-head checks passed, including Python 3.12–3.14 unit/integration jobs, platform E2E, strict parity and packaging/security. Your original contributor commit is preserved in main. Local API validation: 55 passed. Thank you for the focused contribution and affiliation disclosure.

@Shashankss1205
Shashankss1205 merged commit dbfbcb7 into CodeGraphContext:main Oct 15, 2026
1 check failed
@github-project-automation github-project-automation Bot moved this from Backlog tasks to Done in CGC Progress Board Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants