Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ._azure_ai_agent import AzureAIAgent
except ImportError as e:
raise ImportError(
"Dependencies for AzureAIAgent not found. "
f"Dependencies for AzureAIAgent not found. Original error: {e}\n"
'Please install autogen-ext with the "azure" extra: '
'pip install "autogen-ext[azure]"'
) from e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ._magentic_one_coder_agent import MagenticOneCoderAgent
except ImportError as e:
raise ImportError(
"Dependencies for MagenticOneCoderAgent not found. "
f"Dependencies for MagenticOneCoderAgent not found. Original error: {e}\n"
'Please install autogen-ext with the "magentic-one" extra: '
'pip install "autogen-ext[magentic-one]"'
) from e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
from chromadb.api import ClientAPI
except ImportError as e:
raise ImportError(
"To use the ChromaDBVectorMemory the chromadb extra must be installed. Run `pip install autogen-ext[chromadb]`"
f"To use the ChromaDBVectorMemory the chromadb extra must be installed. Original error: {e}\n"
"Run `pip install autogen-ext[chromadb]`"
) from e


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
from redisvl.utils.utils import deserialize, serialize
from redisvl.utils.vectorize import HFTextVectorizer
except ImportError as e:
raise ImportError("To use Redis Memory RedisVL must be installed. Run `pip install autogen-ext[redisvl]`") from e
raise ImportError(
f"To use Redis Memory RedisVL must be installed. Original error: {e}\n"
"Run `pip install autogen-ext[redisvl]`"
) from e


class RedisMemoryConfig(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from ._llama_cpp_completion_client import LlamaCppChatCompletionClient
except ImportError as e:
raise ImportError(
"Dependencies for Llama Cpp not found. "
f"Dependencies for Llama Cpp not found. Original error: {e}\n"
"Please install llama-cpp-python: "
"pip install autogen-ext[llama-cpp]"
) from e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import grpc # type: ignore
except ImportError as e:
raise ImportError(
"To use the GRPC runtime the grpc extra must be installed. Run `pip install autogen-ext[grpc]`"
f"To use the GRPC runtime the grpc extra must be installed. Original error: {e}\n"
"Run `pip install autogen-ext[grpc]`"
) from e

__all__ = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
try:
import grpc.aio
except ImportError as e:
raise ImportError(GRPC_IMPORT_ERROR_STR) from e
raise ImportError(f"{GRPC_IMPORT_ERROR_STR} Original error: {e}") from e

if TYPE_CHECKING:
from .protos.agent_worker_pb2_grpc import AgentRpcAsyncStub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
try:
import grpc
except ImportError as e:
raise ImportError(GRPC_IMPORT_ERROR_STR) from e
raise ImportError(f"{GRPC_IMPORT_ERROR_STR} Original error: {e}") from e
from .protos import agent_worker_pb2_grpc

logger = logging.getLogger("autogen_core")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
try:
import grpc
except ImportError as e:
raise ImportError(GRPC_IMPORT_ERROR_STR) from e
raise ImportError(f"{GRPC_IMPORT_ERROR_STR} Original error: {e}") from e

from .protos import agent_worker_pb2, agent_worker_pb2_grpc, cloudevent_pb2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ async def _get_embedding(self, query: str) -> List[float]:
from openai import AsyncAzureOpenAI

from azure.identity import DefaultAzureCredential
except ImportError:
except ImportError as e:
raise ImportError(
"Azure OpenAI SDK is required for client-side embedding generation. "
f"Azure OpenAI SDK is required for client-side embedding generation. Original error: {e}\n"
"Please install it with: uv add openai azure-identity"
) from None
) from e

api_key = getattr(search_config, "openai_api_key", None)
api_version = getattr(search_config, "openai_api_version", "2023-11-01")
Expand Down Expand Up @@ -193,11 +193,11 @@ def get_token() -> str:
elif embedding_provider.lower() == "openai":
try:
from openai import AsyncOpenAI
except ImportError:
except ImportError as e:
raise ImportError(
"OpenAI SDK is required for client-side embedding generation. "
f"OpenAI SDK is required for client-side embedding generation. Original error: {e}\n"
"Please install it with: uv add openai"
) from None
) from e

api_key = getattr(search_config, "openai_api_key", None)
openai_client = AsyncOpenAI(api_key=api_key)
Expand Down