microsoft/autogen · error · ValueError
Host class must have a search_config attribute
Error message
Host class must have a search_config attribute
What it means
Error "Host class must have a search_config attribute" thrown in microsoft/autogen.
Source
Thrown at python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py:141
class EmbeddingProvider(Protocol):
"""Protocol defining the interface for embedding generation."""
async def _get_embedding(self, query: str) -> List[float]:
"""Generate embedding vector for the query text."""
...
class EmbeddingProviderMixin:
"""Mixin class providing embedding generation functionality."""
search_config: AzureAISearchConfig
async def _get_embedding(self, query: str) -> List[float]:
"""Generate embedding vector for the query text."""
if not hasattr(self, "search_config"):
raise ValueError("Host class must have a search_config attribute")
search_config = self.search_config
embedding_provider = getattr(search_config, "embedding_provider", None)
embedding_model = getattr(search_config, "embedding_model", None)
if not embedding_provider or not embedding_model:
raise ValueError(
"Client-side embedding is not configured. `embedding_provider` and `embedding_model` must be set."
) from None
if embedding_provider.lower() == "azure_openai":
try:
from openai import AsyncAzureOpenAI
from azure.identity import DefaultAzureCredential
except ImportError:
raise ImportError(
"Azure OpenAI SDK is required for client-side embedding generation. "View on GitHub (pinned to 027ecf0a37)
Solutions
- Define search_config on the subclass
Example fix
Set self.search_config = SearchConfig(...) in __init__
When it happens
Trigger: Thrown at python/packages/autogen-ext/src/autogen_ext/tools/azure/_ai_search.py:141 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/d687e2b2a9cfc3b3.
Report an issue: GitHub.