Skip to content

feat(ai): add Atlas Cloud provider support - #188

Open
binyangzhu000-sudo wants to merge 2 commits into
trykimu:mainfrom
binyangzhu000-sudo:feat/atlas-cloud-ai-provider
Open

binyangzhu000-sudo wants to merge 2 commits into
trykimu:mainfrom
binyangzhu000-sudo:feat/atlas-cloud-ai-provider

Conversation

@binyangzhu000-sudo

Copy link
Copy Markdown

Summary

  • add an AI_PROVIDER adapter while keeping Gemini as the default
  • support Atlas Cloud through its OpenAI-compatible chat completions endpoint
  • validate Atlas JSON responses with the existing FunctionCallResponse schema
  • add Atlas API key, base URL, and model configuration to .env.example
  • cover Gemini default behavior, Atlas JSON requests, and invalid providers with focused tests

Configuration

AI_PROVIDER=atlascloud
ATLASCLOUD_API_KEY=your_api_key
ATLASCLOUD_BASE_URL=https://api.atlascloud.ai/v1
ATLASCLOUD_MODEL=deepseek-ai/deepseek-v4-pro

ATLAS_CLOUD_* aliases are also accepted for compatibility.

Validation

  • uv run ruff format --check ai/provider.py ai/routes.py tests/test_ai_provider.py
  • uv run ruff check ai/provider.py ai/routes.py tests/test_ai_provider.py
  • uv run python -m unittest discover -s tests -p "test_*.py" -v (3 passed)
  • uv run mypy .
  • focused repository pre-commit hooks
  • git diff --check
  • live Atlas Cloud deepseek-ai/deepseek-v4-pro chat completion: HTTP 200; JSON output passed FunctionCallResponse validation

No README, logo, sponsor, credits, or partner changes.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 16 complexity · 0 duplication

Metric Results
Complexity 16
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Single conflict in backend/ai/routes.py, and it was not in this branch's own
subject matter: upstream rewrote _ensure_rate_limit_table's double-check from
an early return into a nested if. This branch had only added a
'# type: ignore[unreachable]' comment on that early return, and had also
collapsed the _enforce_rate_limit 'async with' nesting — both incidental to
adding an AI provider abstraction.

Upstream's version is taken for that whole region, which also drops the
unrelated reformatting this branch was carrying. The diff against main is now
confined to what the PR is actually about: ai/provider.py, the three-line
swap in routes.py from the inline Gemini client to generate_ai_response, and
the accompanying config/test/lock entries.

Verification: pytest backend/tests -> 3 passed; mypy clean on the two changed
modules.
@binyangzhu000-sudo

Copy link
Copy Markdown
Author

Synced with main. The single conflict was in backend/ai/routes.py, and it wasn't in this PR's own subject matter: upstream rewrote _ensure_rate_limit_table's double-check from an early return into a nested if. This branch had only added a # type: ignore[unreachable] comment on that early return, and had also collapsed the _enforce_rate_limit async with nesting — both incidental to adding an AI provider abstraction, neither of them something this PR should be carrying.

So upstream's version is taken for that whole region, which drops the unrelated reformatting along with it. The diff against main is now confined to what the PR is actually about: ai/provider.py, the swap in routes.py from the inline Gemini client to generate_ai_response, and the accompanying .env.example / test / lock entries.

Verification on the merged branch:

  • pytest backend/tests → 3 passed
  • mypy ai/routes.py ai/provider.py → no issues

No conflicts remain.

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