Skip to content

Commit fdff362

Browse files
committed
fix: updated docstring in web_search handler
1 parent b169e3e commit fdff362

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ async def _make_brave_api_request(query: str, request: Request) -> Dict[str, Any
9797
9898
Args:
9999
query: The search query string to execute
100+
request: FastAPI request object for rate limiting
100101
101102
Returns:
102103
Dict containing the raw API response data
@@ -242,6 +243,16 @@ async def perform_web_search_async(query: str, request: Request) -> WebSearchCon
242243
Fetches only the exact page for each Brave URL and extracts its
243244
main content with trafilatura. If extraction fails, falls back to
244245
the Brave snippet.
246+
247+
Args:
248+
query: The search query string to execute
249+
request: FastAPI request object for rate limiting
250+
251+
Returns:
252+
WebSearchContext with formatted search results and source information
253+
254+
Raises:
255+
HTTPException: If no results are found (404) or if the API request fails
245256
"""
246257
if not (query and query.strip()):
247258
logger.warning("Empty or invalid query provided for web search")
@@ -721,6 +732,7 @@ async def handle_web_search_for_responses(
721732
req: ResponseRequest containing input to process
722733
model_name: Name of the LLM model to use for query generation
723734
client: LLM client instance for making API calls
735+
request: FastAPI request object for rate limiting
724736
725737
Returns:
726738
WebSearchEnhancedInput with web search context added, or original

0 commit comments

Comments
 (0)