-
Notifications
You must be signed in to change notification settings - Fork 258
feat(aiq-3.0): add initial version of GSF as a data source #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cdgamarose-nv
merged 12 commits into
NVIDIA-AI-Blueprints:develop
from
soumilinandi:feat/gsf-query-tools
Aug 7, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5ad563b
Add GSF structured query tools
soumilinandi 2d13f7b
Align GSF adapter with chat completions
soumilinandi 1fcb85d
Extend GSF query tools and local authentication
soumilinandi d4c15ee
Validate function group registry references
soumilinandi d528a73
Handle GSF prediction PQL response
soumilinandi ef0b8d4
Add GSF catalog search capability
soumilinandi be9a834
Exclude GSF prose from SQL tool output
soumilinandi ed4c1da
Preserve GSF SQL thought summaries
soumilinandi 0d42fd6
Remove unused GSF provenance helper
soumilinandi 185af46
Disable unvalidated GSF PQL tool
soumilinandi f0a1a6b
Harden GSF integration behavior
soumilinandi 9872f90
Harden GSF SSE response handling
soumilinandi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| SPDX-License-Identifier: Apache-2.0 | ||
| --> | ||
|
|
||
| # AI-Q GSF source | ||
|
|
||
| This package exposes NVIDIA Generative Semantic Fabric (GSF) capabilities as a | ||
| NeMo Agent Toolkit function group. The current implementation provides: | ||
|
|
||
| - `gsf__text_to_sql` | ||
| - `gsf__catalog_search` | ||
|
|
||
| PQL client and model groundwork remains internal, but no PQL tool is registered | ||
| until its GSF contract and integration behavior are validated. | ||
|
|
||
| By default, the function group owns one shared HTTP connection pool and keeps | ||
| authentication request-scoped: each tool invocation obtains the current AI-Q | ||
| user token and passes it to GSF without storing it on the client. | ||
| `GSF_BASE_URL` must point to GSF's auth-aware API origin. | ||
|
|
||
| ```yaml | ||
| function_groups: | ||
| gsf: | ||
| _type: gsf | ||
| base_url: ${GSF_BASE_URL} | ||
| include: | ||
| - catalog_search | ||
| - text_to_sql | ||
|
|
||
| functions: | ||
| data_sources: | ||
| _type: data_source_registry | ||
| sources: | ||
| - id: gsf | ||
| name: "Enterprise Structured Data" | ||
| description: >- | ||
| Build authorized semantic context and execute bounded structured-data | ||
| queries through GSF. | ||
| default_enabled: true | ||
| requires_auth: true | ||
| tools: | ||
| - gsf | ||
| ``` | ||
|
|
||
| For local development and automated evaluation without an incoming AI-Q user | ||
| token, explicitly configure a GSF password session. The credentials must come | ||
| from environment variables: | ||
|
|
||
| ```yaml | ||
| function_groups: | ||
| gsf: | ||
| _type: gsf | ||
| base_url: ${GSF_BASE_URL} | ||
| auth: | ||
| mode: password | ||
| email: ${GSF_EMAIL} | ||
| password: ${GSF_PASSWORD} | ||
| include: | ||
| - catalog_search | ||
| - text_to_sql | ||
| ``` | ||
|
|
||
| When `auth` is omitted, the existing request-scoped AI-Q user-token flow is | ||
| used. Password mode creates one GSF session when the function group starts, | ||
| reuses its cookie for local development or evaluation calls, and signs out when | ||
| the group closes. The client does not fall back between authentication methods. | ||
|
|
||
| Text-to-SQL uses GSF's `/api/chat/completions` SSE endpoint with | ||
| `prediction: false`. Its optional AI-Q `database_name` input is sent to GSF as | ||
| `target_db`, selecting an existing GSF connection rather than creating one. | ||
| The adapter normalizes GSF's current response fields while preserving optional | ||
| semantic and benchmarking fields as they become available. | ||
| For text-to-SQL, GSF's compatibility prose is discarded; AI-Q consumes the | ||
| generated SQL, bounded rows, and any structured semantic provenance instead. | ||
| GSF's optional `thoughts` summary is retained as diagnostic context, not as | ||
| authoritative evidence. | ||
|
|
||
| Catalog search uses `POST /api/question-entity-coverage` and returns entity | ||
| coverage plus ranked semantic candidates for DS-agent grounding and routing. | ||
| Its optional `database_name` is sent as `target_db`. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| [build-system] | ||
| build-backend = "setuptools.build_meta" | ||
| requires = ["setuptools >= 83"] | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] | ||
|
|
||
| [project] | ||
| name = "aiq-gsf" | ||
| version = "0.1.0" | ||
| description = "NAT function group for NVIDIA GSF structured-data capabilities" | ||
| readme = "README.md" | ||
| requires-python = ">=3.11,<3.14" | ||
| license = {text = "Apache-2.0"} | ||
| dependencies = [ | ||
| "httpx>=0.27.0,<1", | ||
| "nvidia-nat-core==1.8.0", | ||
| "pydantic>=2.0.0", | ||
| ] | ||
|
|
||
| [project.entry-points."nat.plugins"] | ||
| gsf = "gsf.register" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """AI-Q integration for NVIDIA Generative Semantic Fabric.""" | ||
|
|
||
| from .client import GSFClient | ||
| from .errors import GSFError | ||
| from .errors import GSFErrorCode | ||
|
|
||
| __all__ = ["GSFClient", "GSFError", "GSFErrorCode"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.