Skip to content

Add datasource relevance filter#17

Open
sciapanCA wants to merge 3 commits into
mainfrom
feature/add-datasource-relevance-filter
Open

Add datasource relevance filter#17
sciapanCA wants to merge 3 commits into
mainfrom
feature/add-datasource-relevance-filter

Conversation

@sciapanCA
Copy link
Copy Markdown
Contributor

No description provided.

sciapanCA and others added 2 commits June 6, 2026 18:35
Resolved conflict in src/tools/datasources.py by adapting the query
relevance filter to main's dict envelope convention:
- get_data_sources now returns {dataSources, hint} (from main) and
  additionally carries a `message` field when `query` is supplied
- Empty results use a query-specific hint (_DATASOURCES_EMPTY_QUERY_HINT)
  instead of the 'add a repository' hint when filtering yields nothing
- Tests updated from json.loads(JSON string) assertions to dict shape

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces relevance-filtering to the get_data_sources tool by adding an optional query parameter, which is forwarded to the backend to return intent-relevant data sources along with descriptive messages and hints. Comprehensive unit tests have been added to cover these new behaviors. The review feedback recommends using typing.Optional instead of the PEP 604 union operator (|) to maintain compatibility with Python 3.9 and below, and suggests a more robust try/except block for parsing the total data sources header instead of relying on .isdigit().

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/tools/datasources.py
Comment thread src/tools/datasources.py
Comment thread src/tools/datasources.py Outdated
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