From 66f195b46000c1a3853f5801fd6812a5032d72ae Mon Sep 17 00:00:00 2001 From: Mark Sze <66362098+marklysze@users.noreply.github.com> Date: Sat, 19 Oct 2024 06:18:41 +1100 Subject: [PATCH] Cerebras exception correction, added Gemini installation advice (#66) --- autogen/oai/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autogen/oai/client.py b/autogen/oai/client.py index a740e3f0f3d0..ccf402c07a0e 100644 --- a/autogen/oai/client.py +++ b/autogen/oai/client.py @@ -59,6 +59,7 @@ cerebras_import_exception: Optional[ImportError] = None except ImportError as e: + cerebras_AuthenticationError = cerebras_InternalServerError = cerebras_RateLimitError = Exception cerebras_import_exception = e try: @@ -577,7 +578,7 @@ def _register_default_client(self, config: Dict[str, Any], openai_config: Dict[s self._clients.append(client) elif api_type is not None and api_type.startswith("google"): if gemini_import_exception: - raise ImportError("Please install `google-generativeai` to use Google OpenAI API.") + raise ImportError("Please install `google-generativeai` and 'vertexai' to use Google's API.") client = GeminiClient(**openai_config) self._clients.append(client) elif api_type is not None and api_type.startswith("anthropic"):