fix: implement search_stackoverflow_threads and standardize tool interface#284
fix: implement search_stackoverflow_threads and standardize tool interface#284jaishree-verma wants to merge 3 commits intojenkinsci:mainfrom
Conversation
…rface - Replace no-op stub in search_stackoverflow_threads that always returned hardcoded 'Nothing relevant' with real retrieval logic - Add missing keywords and logger parameters to match the interface contract of all other search tools - Add stackoverflow source name to config.yml and config-testing.yml - Add top_k_stackoverflow to retrieval config in both yml files - Fix TOOL_SIGNATURES in utils.py to include keywords for stackoverflow - Fix get_default_tools_call to pass keywords for stackoverflow tool - Add test_tools.py with unit tests covering the fix
|
Duplicates |
| plugins: "plugins" | ||
| jenkins_docs: "docs" | ||
| community_threads: "discourse" | ||
| stackoverflow: "stackoverflow" #-> first change |
There was a problem hiding this comment.
Remove the first, second, ...
There was a problem hiding this comment.
Thank you for the review @berviantoleo!
I checked PR #172. The key difference in my PR is that it also standardizes the tool interface by adding keywords and logger parameters to match the contract of the other 3 search tools (search_jenkins_docs, search_plugin_docs, search_community_threads).
PR #172 keeps search_stackoverflow_threads(query) only, which leaves the interface inconsistency unfixed.
I will remove the inline comment (#-> first change) from both config files as requested. Should I also address the interface standardization separately or keep it in this PR?
There was a problem hiding this comment.
I prefer to comment on existing PR, suggest the what you found that the contributor will miss. It's another way to contribute. Contribution doesn't mean you need to be an author; as a pair-reviewer, it's also valuable.
There was a problem hiding this comment.
Understood! I will go to PR #172 and leave a review comment there pointing out the interface inconsistency.
Thank you for the guidance @berviantoleo!
Problem
search_stackoverflow_threadswas a no-op stub that always returnedhardcoded "Nothing relevant" regardless of the user query. It also
had an inconsistent interface - missing
keywordsandloggerparameters that all other search tools accept.
Changes
retrieve_documentsextract_top_chunks, consistent withsearch_jenkins_docs,search_plugin_docs, andsearch_community_threadskeywordsandloggerparameters to match tool interface contractstackoverflowsource name toconfig.ymlandconfig-testing.ymltop_k_stackoverflowto retrieval config in both yml filesTOOL_SIGNATURESinutils.pyto includekeywordsfor stackoverflowget_default_tools_callto passkeywordsfor the stackoverflow tooltest_tools.pywith unit tests covering the fixTesting
Added
tests/unit/tools/test_tools.pywith tests verifying:extract_top_chunks(not hardcoded string)retrieve_documentsis called with correctqueryandkeywordsTOOL_SIGNATURESincludeskeywordsfor stackoverflowget_default_tools_callincludeskeywordsfor stackoverflow