microsoft/autogen · error · ValueError
Search query cannot be empty
Error message
Search query cannot be empty
What it means
Error "Search query cannot be empty" thrown in microsoft/autogen.
Source
Thrown at python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py:434
self, args: Union[str, Dict[str, Any], SearchQuery], cancellation_token: Optional[CancellationToken] = None
) -> SearchResults:
"""Execute a search against the Azure AI Search index.
Args:
args: Search query text or SearchQuery object
cancellation_token: Optional token to cancel the operation
Returns:
SearchResults: Container with search results and metadata
Raises:
ValueError: If the search query is empty or invalid
ValueError: If there is an authentication error or other search issue
asyncio.CancelledError: If the operation is cancelled
"""
if isinstance(args, str):
if not args.strip():
raise ValueError("Search query cannot be empty")
search_query = SearchQuery(query=args)
elif isinstance(args, dict) and "query" in args:
search_query = SearchQuery(query=args["query"])
elif isinstance(args, SearchQuery):
search_query = args
else:
raise ValueError("Invalid search query format. Expected string, dict with 'query', or SearchQuery")
if cancellation_token is not None and cancellation_token.is_cancelled():
raise asyncio.CancelledError("Operation cancelled")
cache_key = ""
if self.search_config.enable_caching:
cache_key_parts = [
search_query.query,
str(self.search_config.top),
self.search_config.query_type,
",".join(sorted(self.search_config.search_fields or [])),View on GitHub (pinned to 027ecf0a37)
Solutions
- Provide non-empty query text
Example fix
Pass a non-empty string query
When it happens
Trigger: Thrown at python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py:434 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/autogen@027ecf0a37 (2026-08-15).
Data as JSON: /api/errors/37fa31d861886d30.
Report an issue: GitHub.