Skip to content

Commit

Permalink
Cerebras exception correction, added Gemini installation advice (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklysze authored Oct 18, 2024
1 parent e318461 commit 66f195b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autogen/oai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit 66f195b

Please sign in to comment.