Skip to content

Conversation

@blefo
Copy link
Member

@blefo blefo commented Jul 23, 2025

  • Changed dependency from duckduckgo-search (deprecated) to ddgs
  • Updated web search functions to query Brave instead of DuckDuckGo, including modifications to the search logic and response handling.
  • Added a step to generate a concise search query using the LLM before performing the web search, improving the relevance of search results.

@blefo blefo requested a review from Copilot July 23, 2025 13:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the web search implementation to use the Brave API instead of DuckDuckGo, migrates to the ddgs library, and adds an LLM-based query generation step to improve search relevance.

  • Changed dependency from duckduckgo-search to ddgs library
  • Updated web search to use Brave API backend instead of DuckDuckGo
  • Added query generation step using LLM to create concise search queries before performing web searches

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Updated dependency from duckduckgo-search to ddgs
nilai_api/handlers/web_search.py Core changes to use Brave API, added LLM query generation, and updated function signatures
nilai_api/routers/private.py Updated client initialization and function calls to support new web search interface
tests/unit/nilai_api/test_web_search.py Updated test mocks and function calls to match new signatures
tests/unit/nilai_api/routers/test_private.py Fixed OpenAI client mocking for async operations
tests/e2e/test_openai.py Increased retry count for web search tests
Comments suppressed due to low confidence (2)

nilai-api/src/nilai_api/handlers/web_search.py:87

  • The parameter client should have a type annotation for better code clarity and type safety.
) -> str:

nilai-api/src/nilai_api/handlers/web_search.py:107

  • The parameter client should have a type annotation for better code clarity and type safety.
) -> EnhancedMessages:

@blefo blefo requested a review from jcabrero July 23, 2025 13:16
Enhance web result fetching utilizing the Brave browser; Introduce a step to rephrase web search queries from the user's initial prompt.
@blefo blefo force-pushed the feat-web-search-v2 branch from 8260d65 to 60af94d Compare July 23, 2025 15:04
@blefo blefo force-pushed the feat-web-search-v2 branch from b3a9235 to 9e0d3cf Compare July 24, 2025 15:08
Copy link
Member

@jcabrero jcabrero left a comment

Choose a reason for hiding this comment

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

👍

@blefo blefo force-pushed the feat-web-search-v2 branch from f2459f4 to bdb9f5c Compare July 28, 2025 12:20
@blefo blefo force-pushed the feat-web-search-v2 branch from bdb9f5c to acc0b1d Compare July 28, 2025 12:24
@blefo blefo merged commit f990362 into main Jul 28, 2025
5 checks passed
@jcabrero jcabrero deleted the feat-web-search-v2 branch July 31, 2025 09:15
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.

3 participants