Skip to content

add:pg_ai_query#3

Closed
OreoYang wants to merge 1 commit intomasterfrom
pg_ai_query
Closed

add:pg_ai_query#3
OreoYang wants to merge 1 commit intomasterfrom
pg_ai_query

Conversation

@OreoYang
Copy link
Owner

@OreoYang OreoYang commented Mar 3, 2026

Summary by CodeRabbit

  • Documentation
    • Added comprehensive documentation for the pg_ai_query extension in Chinese and English
    • Includes quick start guide, configuration instructions, usage examples, and best practices
    • Covers installation, setup, supported models, security features, and error handling

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

📝 Walkthrough

Walkthrough

Added documentation for the pg_ai_query extension across both Chinese and English documentation sets. Updated navigation files to include references to the new extension, and created comprehensive documentation files covering installation, configuration, usage examples, and best practices.

Changes

Cohort / File(s) Summary
Navigation Updates
CN/modules/ROOT/nav.adoc, EN/modules/ROOT/nav.adoc
Added navigation entries for pg_ai_query under ecosystem_components section in both language variants.
Documentation Files
CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc, EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc
New comprehensive documentation files describing pg_ai_query extension features, installation steps, configuration options, usage examples, error handling, and best practices for both Chinese and English documentation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A query's wish, now whispered in plain speech,
AI grasps what SQL once taught to reach,
Through config files and prompts so fine,
Documentation blooms—a guide divine!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'add:pg_ai_query' is vague and uses a generic format that doesn't clearly convey what is being added or why it matters. Consider using a more descriptive title like 'Add pg_ai_query extension documentation' to better summarize the main change.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pg_ai_query

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc (1)

122-123: Use portable path examples instead of user-specific absolute paths.

/home/highgo/... is environment-specific. Prefer $HOME/... (or ~) in docs to avoid confusion.

Proposed doc fix
-system_prompt = /home/highgo/.pg_ai.prompts
-explain_system_prompt = /home/highgo/.pg_ai.explain.prompts
+system_prompt = $HOME/.pg_ai.prompts
+explain_system_prompt = $HOME/.pg_ai.explain.prompts
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc` around
lines 122 - 123, Replace the user-specific absolute paths assigned to
system_prompt and explain_system_prompt with portable home-relative examples
(e.g., use $HOME/.pg_ai.prompts or ~/.pg_ai.prompts) so the documentation
doesn't reference /home/highgo; update the values for system_prompt and
explain_system_prompt accordingly.
CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc (1)

122-123: 建议将示例路径改为可移植写法。

当前 /home/highgo/... 为机器相关路径,建议改为 $HOME/...~

建议修改
-system_prompt = /home/highgo/.pg_ai.prompts
-explain_system_prompt = /home/highgo/.pg_ai.explain.prompts
+system_prompt = $HOME/.pg_ai.prompts
+explain_system_prompt = $HOME/.pg_ai.explain.prompts
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc` around
lines 122 - 123, The example uses machine-specific absolute paths for
system_prompt and explain_system_prompt; update the assignments for
system_prompt and explain_system_prompt to use a portable home reference (e.g.,
$HOME/... or ~/...) instead of /home/highgo/... so the example works across
environments and shells.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc`:
- Line 17: 将文档中列出的 Anthropic 模型 ID 更新为当前推荐版本:把 "claude-sonnet-4-5-20250929" 替换为
"claude-sonnet-4-6",将 "claude-3-haiku-20240307" 移除或替换为当前可用型号(如不确定则删除),并把
"claude-4.5-opus" 改为正确格式 "claude-opus-4-6"(或 "claude-opus-4-5"
若需固定旧版本);同时可选地使用别名(例如
"claude-sonnet-4-6"、"claude-opus-4-6")以自动跟随最新模型,或保留带日期的精确版本以保证可复现性(在文档中更新对应字符串:
gpt-4o-mini, gpt-4o, gpt-5, claude-3-haiku-20240307, claude-sonnet-4-5-20250929,
claude-4.5-opus)。

In `@EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc`:
- Line 17: Replace the two invalid model IDs listed in the multi-model support
line: swap `claude-4.5-opus` with the valid Anthropic ID
`claude-opus-4-5-20251101` (or the alias `claude-opus-4-5`), and replace `gpt-5`
with a current OpenAI GPT-5 variant such as `gpt-5-turbo` or `gpt-5-mini`;
ensure the updated string still reads as a comma-separated list and keep
`claude-sonnet-4-5-20250929` unchanged.

---

Nitpick comments:
In `@CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc`:
- Around line 122-123: The example uses machine-specific absolute paths for
system_prompt and explain_system_prompt; update the assignments for
system_prompt and explain_system_prompt to use a portable home reference (e.g.,
$HOME/... or ~/...) instead of /home/highgo/... so the example works across
environments and shells.

In `@EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc`:
- Around line 122-123: Replace the user-specific absolute paths assigned to
system_prompt and explain_system_prompt with portable home-relative examples
(e.g., use $HOME/.pg_ai.prompts or ~/.pg_ai.prompts) so the documentation
doesn't reference /home/highgo; update the values for system_prompt and
explain_system_prompt accordingly.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f7b8e4 and 1357ec2.

📒 Files selected for processing (4)
  • CN/modules/ROOT/nav.adoc
  • CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc
  • EN/modules/ROOT/nav.adoc
  • EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc

主要特性:

* **自然语言转 SQL**:将语言描述转换为有效的 PostgreSQL 查询
* **多模型支持**:支持 gpt-4o-mini、gpt-4o、gpt-5、claude-3-haiku-20240307、claude-sonnet-4-5-20250929、claude-4.5-opus 等大模型
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

OpenAI gpt-5 model API name 2026 availability

💡 Result:

  • API model names (GPT‑5 family): gpt-5, gpt-5-mini, gpt-5-nano (and the ChatGPT non-reasoning variant: gpt-5-chat-latest). [1]
  • Availability in 2026: GPT‑5 models are available in the OpenAI API (including Responses API and Chat Completions API) and accessible to API usage tiers 1–5 (some access may require organization verification). [1][2][3]
  • ChatGPT vs API note (relevant to 2026): Even though OpenAI announced GPT‑5 would be retired in ChatGPT on February 13, 2026, it continues to be available via the API (with advance notice promised for any future API retirements). [4]

Sources:
[1] OpenAI blog: “Introducing GPT‑5 for developers” (Aug 7, 2025) (openai.com)
[2] OpenAI API docs: “GPT‑5 Model” (developers.openai.com)
[3] OpenAI Help: “API Model Availability by Usage Tier and Verification Status” (help.openai.com)
[4] OpenAI Help: “Retiring GPT‑4o and other ChatGPT models” (help.openai.com)

Citations:


🌐 Web query:

Anthropic Claude API model names 2026 claude-sonnet-4-5 claude-opus recommended

💡 Result:

Current Anthropic Claude API model IDs (as of March 3, 2026)

Recommended defaults

About the names you mentioned

  • claude-sonnet-4-5 is a valid model alias (with a pinned variant like claude-sonnet-4-5-20250929). (docs.claude.com)
  • In 2026, Sonnet 4.6 is the newer Sonnet line model ID you’d typically choose over 4.5: claude-sonnet-4-6. (anthropic.com)

Practical recommendation

  • Use aliases (claude-sonnet-4-6, claude-opus-4-6) if you want the current model in that family. (platform.claude.com)
  • Use pinned IDs (date-suffixed) when you need strict reproducibility; you can also list what your account supports via GET /v1/models. (docs.claude.com)

Citations:


🌐 Web query:

OpenAI gpt-4o-mini gpt-4o current model IDs March 2026

💡 Result:

As of March 2026, the OpenAI API docs list these current model IDs:

  • GPT‑4o

    • Alias (recommended): gpt-4o
    • Snapshots: gpt-4o-2024-11-20, gpt-4o-2024-08-06, gpt-4o-2024-05-13 [1]
  • GPT‑4o mini

    • Alias (recommended): gpt-4o-mini
    • Snapshot: gpt-4o-mini-2024-07-18 [2]

Sources: OpenAI model docs for GPT‑4o [1] and GPT‑4o mini [2].


更新 Anthropic 模型 ID 为当前推荐版本。

OpenAI 模型(gpt-4o-minigpt-4ogpt-5)的命名正确且当前可用。但 Anthropic 模型存在以下问题:

  • claude-sonnet-4-5-20250929 已过时,应更新为 claude-sonnet-4-6(2026年当前推荐版本)
  • claude-3-haiku-20240307 不在当前API推荐列表中,考虑移除或替换为当前可用的模型
  • claude-4.5-opus 命名格式错误,应改为 claude-opus-4-6(当前推荐)或 claude-opus-4-5(如需特定版本)

建议使用模型别名(如 claude-sonnet-4-6claude-opus-4-6)以自动获得最新模型,或使用带日期的版本以确保再现性。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc` at line
17, 将文档中列出的 Anthropic 模型 ID 更新为当前推荐版本:把 "claude-sonnet-4-5-20250929" 替换为
"claude-sonnet-4-6",将 "claude-3-haiku-20240307" 移除或替换为当前可用型号(如不确定则删除),并把
"claude-4.5-opus" 改为正确格式 "claude-opus-4-6"(或 "claude-opus-4-5"
若需固定旧版本);同时可选地使用别名(例如
"claude-sonnet-4-6"、"claude-opus-4-6")以自动跟随最新模型,或保留带日期的精确版本以保证可复现性(在文档中更新对应字符串:
gpt-4o-mini, gpt-4o, gpt-5, claude-3-haiku-20240307, claude-sonnet-4-5-20250929,
claude-4.5-opus)。

Key features:

* **Natural Language to SQL**: Convert plain English descriptions into valid PostgreSQL queries
* **Multi-model Support**: Supports gpt-4o-mini, gpt-4o, gpt-5, claude-3-haiku-20240307, claude-sonnet-4-5-20250929, claude-4.5-opus and other large models
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

OpenAI current available models gpt-4o-mini gpt-4o gpt-5 API 2026

💡 Result:

As of March 3, 2026, OpenAI’s API docs list these as currently available (model IDs shown):

  • gpt-4o-mini — multimodal (text+image in, text out), 128k context, 16,384 max output tokens. [1]
  • gpt-4o — multimodal (text+image in, text out), 128k context, 16,384 max output tokens. [2]
  • gpt-5 — listed as a previous reasoning/agentic model (OpenAI recommends newer GPT‑5.x models), 400k context, 128k max output tokens. [3]

The Models page also shows newer GPT‑5 family models (for example GPT‑5.2 / GPT‑5 mini / GPT‑5 nano) as “featured/frontier” options. [4]

Related: OpenAI’s Deprecations page shows several legacy GPT‑4 snapshot model IDs scheduled to shut down on March 26, 2026 (e.g., gpt-4-0314, gpt-4-1106-preview, gpt-4-0125-preview). [5]


🌐 Web query:

Anthropic Claude current model names claude-sonnet-4-5-20250929 claude-4.5-opus API documentation

💡 Result:

  • claude-sonnet-4-5-20250929 is an official Anthropic Claude API model ID (Claude Sonnet 4.5). Anthropic also documents the alias claude-sonnet-4-5. [1]
  • For “Opus 4.5”, the official Claude API model ID is claude-opus-4-5-20251101 (alias claude-opus-4-5). claude-4.5-opus is not an Anthropic-documented model ID. [1]
  • To discover the currently available/accepted model IDs for your API key, use the Models API: GET /v1/models (docs: “List Models”). [2]
  • Anthropic’s “Model deprecations” page also lists claude-sonnet-4-5-20250929 and claude-opus-4-5-20251101 as Active. [3]

Sources:
[1] Anthropic docs — “What’s new in Claude 4.5” (availability table with 4.5 model IDs) (platform.claude.com)
[2] Anthropic docs — “List Models” (GET /v1/models) (platform.claude.com)
[3] Anthropic docs — “Model deprecations” (model status table) (platform.claude.com)

Citations:


🏁 Script executed:

cd EN/modules/ROOT/pages/master/ecosystem_components && head -n 120 pg_ai_query.adoc | tail -n 20

Repository: OreoYang/ivorysql_docs

Length of output: 547


🏁 Script executed:

cd EN/modules/ROOT/pages/master/ecosystem_components && sed -n '15,20p' pg_ai_query.adoc

Repository: OreoYang/ivorysql_docs

Length of output: 512


Correct invalid model IDs on Line 17.

Two model names are incorrect or outdated:

  • claude-4.5-opus — not a valid Anthropic model ID; use claude-opus-4-5-20251101 or alias claude-opus-4-5 instead.
  • gpt-5 — deprecated by OpenAI; use GPT-5.x variants (e.g., gpt-5-turbo or gpt-5-mini) from current API docs.

Line 115 is correct (claude-sonnet-4-5-20250929 is active).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@EN/modules/ROOT/pages/master/ecosystem_components/pg_ai_query.adoc` at line
17, Replace the two invalid model IDs listed in the multi-model support line:
swap `claude-4.5-opus` with the valid Anthropic ID `claude-opus-4-5-20251101`
(or the alias `claude-opus-4-5`), and replace `gpt-5` with a current OpenAI
GPT-5 variant such as `gpt-5-turbo` or `gpt-5-mini`; ensure the updated string
still reads as a comma-separated list and keep `claude-sonnet-4-5-20250929`
unchanged.

@OreoYang OreoYang closed this Mar 3, 2026
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