Skip to content

feat(nl2sql): add GLM, Doubao, and Sakana Fugu providers (19 → 22)#252

Merged
devopam merged 2 commits into
mainfrom
feat/nl2sql-doubao-glm-sakana
Jul 7, 2026
Merged

feat(nl2sql): add GLM, Doubao, and Sakana Fugu providers (19 → 22)#252
devopam merged 2 commits into
mainfrom
feat/nl2sql-doubao-glm-sakana

Conversation

@devopam

@devopam devopam commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Widens the built-in translate_nl_to_sql fleet from 19 to 22 OpenAI-compatible providers — a low-risk adoption win. Each is a one-line entry in the nl2sql._PROVIDERS registry (every derived lookup table updates automatically):

Provider Base URL Key env var Default model
GLM (Zhipu AI / Z.ai) https://api.z.ai/api/paas/v4 ZAI_API_KEY (→ ZHIPUAI_API_KEY) glm-4.5-flash
Doubao (ByteDance / Volcengine Ark) https://ark.cn-beijing.volces.com/api/v3 ARK_API_KEY doubao-seed-1-6-251015
Sakana Fugu https://api.sakana.ai/v1 SAKANA_API_KEY fugu

Base URLs, key env vars, and default models were each verified against the vendor's own docs. Adoption caveat: Doubao requires the model to be activated in the Ark console before the id resolves (documented in the user-guide row).

Docs bumped 19→22 (README, tools.md, tour.md); three rows added to the user-guide.md provider table; release-notes-0.6.9.md left at 19 (that release genuinely shipped 19). Key-discovery test extended with the new deviating env vars (ZAI_API_KEY, ARK_API_KEY).

Roadmap linkage

Advances roadmap row: N/A — extends the existing NL→SQL provider registry (feature already shipped; this is a data-only expansion).

Checklist

  • Tests added/updated first; suite passes locally (38 provider tests green)
  • ruff, ruff format, and mypy src/mcpg pass
  • CHANGELOG.md updated under [Unreleased]
  • Roadmap row cited (N/A)
  • No hand-edits to src/mcpg/_vendor/

🤖 Generated with Claude Code


Generated by Claude Code

Summary by Sourcery

Expand the built-in NL→SQL provider registry with three additional OpenAI-compatible vendors and update docs, changelog, and tests to reflect the enlarged provider fleet.

New Features:

  • Add GLM (Zhipu AI / Z.ai) as a built-in NL→SQL provider with documented base URL, default model, and API key env vars.
  • Add Doubao (ByteDance / Volcengine Ark) as a built-in NL→SQL provider with its default model and API key env var.
  • Add Sakana Fugu as a built-in NL→SQL provider with its default model and API key env var.

Enhancements:

  • Update configuration discovery tests to cover the new NL→SQL providers and their vendor-specific env vars.
  • Refresh README, tools reference, user guide, and tour docs to reflect the expansion from 19 to 22 built-in NL→SQL providers.
  • Document the new providers and their configuration details in the changelog.

Three more built-in OpenAI-compatible NL->SQL providers, each a one-line
_PROVIDERS registry entry (all derived lookup tables update automatically):

- glm     -> https://api.z.ai/api/paas/v4        ZAI_API_KEY (fallback ZHIPUAI_API_KEY)  glm-4.5-flash
- doubao  -> https://ark.cn-beijing.volces.com/api/v3  ARK_API_KEY  doubao-seed-1-6-251015
- sakana  -> https://api.sakana.ai/v1            SAKANA_API_KEY  fugu

Base URLs, key env vars, and default models verified against each
vendor's official docs. Extended the key-discovery test with the new
deviating env vars (ZAI_API_KEY, ARK_API_KEY). Bumped the built-in count
to 22 in README/tools.md/tour.md and added the three rows to the
user-guide provider table. release-notes-0.6.9 left at 19 (historical).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tests/unit/test_config.py" line_range="420-422" />
<code_context>
         ("GITHUB_TOKEN", "github"),  # deviates
         ("DEEPINFRA_TOKEN", "deepinfra"),  # deviates
         ("SAMBANOVA_API_KEY", "sambanova"),
+        ("ZAI_API_KEY", "glm"),  # deviates
+        ("ARK_API_KEY", "doubao"),  # deviates
+        ("SAKANA_API_KEY", "sakana"),
     ],
 )
</code_context>
<issue_to_address>
**suggestion (testing):** Add a test case for the legacy `ZHIPUAI_API_KEY` fallback env var for GLM

The GLM provider spec accepts both `ZAI_API_KEY` and the legacy `ZHIPUAI_API_KEY`. This parametrized test only covers `ZAI_API_KEY`. Please extend the parametrization to also include `("ZHIPUAI_API_KEY", "glm")` so the legacy env var behavior is covered and guarded against regressions.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread tests/unit/test_config.py
@gemini-code-assist-2

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

Addresses Sourcery review on #252 — the GLM spec accepts both ZAI_API_KEY
and the legacy ZHIPUAI_API_KEY; parametrize the key-discovery test for the
fallback too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0122yLZLJ8t4W43sdN6BmTZc
@devopam devopam merged commit f2dc8bd into main Jul 7, 2026
10 checks passed
@devopam devopam deleted the feat/nl2sql-doubao-glm-sakana branch July 7, 2026 20:47
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.

2 participants