fix: search queries no longer show up in the default server log (#33701)

The external reranker, Exa and Ollama web search wrote the full user query to the server log at info level, and reusing generated search queries logged them as well. Those lines no longer include the query. A failing external reranker also logged the provider URL in its error message along with a stack trace; it now logs only the error type.

Co-authored-by: manooll <16244686+manooll@users.noreply.github.com>
This commit is contained in:
Classic298andmanooll authored and GitHub committed 2026-11-04 06:00:28 +09:00
1 parent ad66f2c41a
commit 8d7b71f6cc
4 files changed
+4 -5

No files matched your search

@@ -36,7 +36,6 @@ class ExternalReranker(BaseReranker):
try:
log.info('ExternalReranker:predict:model %s', self.model)
log.info('ExternalReranker:predict:query %s', query)
headers = {
'Content-Type': 'application/json',
@@ -65,5 +64,5 @@ class ExternalReranker(BaseReranker):
return None
except Exception as e:
log.exception(f'Error in external reranking: {e}')
log.error('Error in external reranking: %s', type(e).__name__)
return None
+1 -1
View File
@@ -24,7 +24,7 @@ def search_exa(
filter_list (list[str] | None): List of domains to filter results by
max_content_length (int | None): Maximum characters per result; None leaves text unlimited.
"""
log.info('Searching with Exa for query: %s', query)
log.info('Searching with Exa')
headers = {'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json'}
+1 -1
View File
@@ -23,7 +23,7 @@ def search_ollama_cloud(
count (int): Number of results to return
filter_list (Optional[list[str]]): List of domains to filter results by
"""
log.info('Searching with Ollama for query: %s', query)
log.info('Searching with Ollama')
headers = {'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json'}
payload = {'query': query, 'max_results': count}
+1 -1
View File
@@ -419,7 +419,7 @@ async def generate_queries(request: Request, form_data: dict, user=Depends(get_v
)
if getattr(request.state, 'cached_queries', None):
log.info('Reusing cached queries: %s', request.state.cached_queries)
log.info('Reusing cached queries')
return request.state.cached_queries
if getattr(request.state, 'direct', False) and hasattr(request.state, 'model'):