feat(gsf): Add tool text_to_pql in GSF data source - #434
Conversation
Signed-off-by: Soumili Nandi <soumilin@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
🧰 Additional context used📓 Path-based instructions (7)**/*📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.py📄 CodeRabbit inference engine (CONTRIBUTING.md)
Files:
**/*.{py,pyi}📄 CodeRabbit inference engine (AGENTS.md)
Files:
sources/**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,pyi,js,jsx,ts,tsx,yml,yaml,json,env,md}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,pyi,js,jsx,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
{src/aiq_agent/knowledge/**,sources/**}⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (1)📚 Learning: 2026-08-11T06:34:44.687ZApplied to files:
🔇 Additional comments (2)
WalkthroughGSF adds prediction-based ChangesGSF text-to-PQL prediction
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant text_to_pql
participant GSFClient
participant GSFAPI
Caller->>text_to_pql: Submit prediction request
text_to_pql->>GSFClient: Forward request and authentication
GSFClient->>GSFAPI: Send prediction query
GSFAPI-->>GSFClient: Return PQL, diagnostics, and result data
GSFClient-->>text_to_pql: Return normalized response
text_to_pql-->>Caller: Serialize response or structured error
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sources/gsf/src/gsf/register.py`:
- Around line 177-178: Update the exception handler in the GSF text-to-PQL
failure path to stop using logger.exception, which emits raw traceback and
message content. Log only the exception type together with redacted metadata
from log_content_metadata(exception), preserving the existing unexpected-failure
handling without exposing exception details.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 8f57cce6-b8b6-4ab0-848b-f10b4073f9c5
📒 Files selected for processing (8)
sources/gsf/README.mdsources/gsf/src/gsf/client.pysources/gsf/src/gsf/models.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/tests/test_client.pysources/gsf/tests/test_models.pysources/gsf/tests/test_register.py
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: Pytest and Coverage
- GitHub Check: Script Validation
- GitHub Check: Lint and Hooks
🧰 Additional context used
📓 Path-based instructions (7)
**/*
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*: Do not include secrets, credentials, private hostnames, internal-only logs, customer data, or generated local artifacts.
Add or update tests for behavior changes.
**/*: For substantial behavior, authentication, UI, or architecture changes, open a design discussion before coding rather than landing a large unreviewed change.
Keep changes scoped to this repository and avoid editing adjacent repositories; treat eachsources/*package independently and prefer the smallest package-scoped change.
Keep pull requests scoped, avoid unrelated files and generated artifacts, provide validation evidence, and ensure every commit has DCO sign-off.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/README.mdsources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
**/*.py
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.py: Runuv run ruff check .anduv run ruff format --check .for root Python changes.
Runuv run pytestfor root project Python changes.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
**/*.{py,pyi}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{py,pyi}: Format and lint Python code with Ruff using line length 120, Python 3.11 targeting, rules E, F, W, I, PL, and UP, with single-line imports; do not reformat unrelated code.
Missing-secret paths must degrade gracefully by stubbing or skipping rather than crashing or leaking secrets.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
sources/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
sources/**/*.py: Implement new tools and data sources as NeMo Agent Toolkit functions registered with@register_function; configuration schemas must inherit fromFunctionBaseConfig.
Register new data sources indata_source_registryso the UI can toggle them.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
**/*.{py,pyi,js,jsx,ts,tsx,yml,yaml,json,env,md}
📄 CodeRabbit inference engine (AGENTS.md)
Never commit secrets, tokens, or environment-specific hostnames; use environment variables and
SecretStr, and resolve API keys at runtime.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/README.mdsources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
**/*.{py,pyi,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Never print or log secret values, including in tool output or error messages.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
{src/aiq_agent/knowledge/**,sources/**}
⚙️ CodeRabbit configuration file
{src/aiq_agent/knowledge/**,sources/**}: Review data-source and knowledge-layer changes for optional dependency boundaries, external API error handling,
retry/rate-limit behavior, deterministic tests, and registration consistency. New source packages should include
package metadata, plugin registration when applicable, and source-level tests.
Files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/README.mdsources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
🧠 Learnings (1)
📚 Learning: 2026-08-11T06:34:44.687Z
Learnt from: AjayThorve
Repo: NVIDIA-AI-Blueprints/aiq PR: 429
File: src/aiq_agent/agents/deep_researcher/register.py:302-307
Timestamp: 2026-08-11T06:34:44.687Z
Learning: In Python logging code that handles potentially sensitive exceptions, do not add `exc_info=True` solely to restore stack traces, because standard traceback formatting includes `str(exception)` and may expose provider, customer, or credential-bearing content. When sensitive-content redaction is required, log the exception type together with `log_content_metadata(exception)` instead.
Applied to files:
sources/gsf/tests/test_models.pysources/gsf/tests/test_register.pysources/gsf/src/gsf/register.pysources/gsf/tests/conftest.pysources/gsf/src/gsf/models.pysources/gsf/tests/test_client.pysources/gsf/src/gsf/client.py
🔇 Additional comments (18)
sources/gsf/src/gsf/models.py (2)
80-87: LGTM!
110-119: LGTM!sources/gsf/src/gsf/client.py (2)
180-193: LGTM!
568-606: LGTM!sources/gsf/tests/conftest.py (2)
73-77: LGTM!
126-131: LGTM!sources/gsf/tests/test_models.py (2)
81-88: LGTM!
128-131: LGTM!sources/gsf/tests/test_client.py (3)
227-253: LGTM!
256-278: LGTM!
281-302: LGTM!sources/gsf/src/gsf/register.py (2)
28-28: LGTM!
160-185: 📐 Maintainability & Code QualityKeep
text_to_pqlin the function group registration.
@register_function_groupregisters the builder, andFunctionGroup.add_functionregisters its individual tools. Do not add@register_functionto the nested function.> Likely an incorrect or invalid review comment.sources/gsf/tests/test_register.py (2)
13-13: LGTM!
97-109: LGTM!sources/gsf/README.md (3)
6-18: LGTM!
28-28: LGTM!
45-72: LGTM!
Signed-off-by: Soumili Nandi <soumilin@nvidia.com>
|
/ok to test 2e850b6 |
|
/merge |
1 similar comment
|
/merge |
2ffe0c8
into
NVIDIA-AI-Blueprints:develop
Overview
Adds the
gsf__text_to_pqltool to the existing GSF function group. The tool callsPOST /api/chat/completionswithprediction: trueand returns generated PQL, bounded prediction rows, response text, thoughts, and available diagnostics.Normal AI-Q calls rely on GSF routing without specifying a database. Automated benchmarks may optionally provide
database_name, which is forwarded astarget_db.The README documents the tool, API mapping, request-scoped user-token forwarding, and password-session lifecycle for development and evaluation.
DCO sign-off for the squash commit
Signed-off-by: Soumili Nandi soumilin@nvidia.com
Validation
.venv/bin/pytest sources/gsf/tests— 43 passed.venv/bin/ruff check sources/gsf— passed.venv/bin/ruff format --check sources/gsf— passedgit diff --check— passedPre-commit hooks, including secret detection and Markdown link checking — passed
I ran the relevant local checks or explained why they are not applicable.
I added or updated tests for behavior changes.
I updated documentation for user-facing or contributor-facing changes.
I confirmed this PR does not include secrets, credentials, or internal-only data.
I certify this contribution under the Developer Certificate of Origin (DCO) and signed my commits with
git commit -sor an equivalent sign-off.I replaced the DCO sign-off placeholder with my GitHub commit identity and kept the required angle brackets around the email address.
Where should reviewers start?
Start with
text_to_pqlinsources/gsf/src/gsf/client.py, its registration insources/gsf/src/gsf/register.py, and the default versus benchmark-scoped request tests insources/gsf/tests/test_client.py.Related Issues
Summary by CodeRabbit
New Features
Documentation
Tests