Catch GoogleAPICallError in Google Generative AI (#119118)

This commit is contained in:
tronikos 2024-06-07 23:51:42 -07:00 committed by GitHub
parent e4be3d8435
commit 5fdfafd57f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,7 +71,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
try: try:
response = await model.generate_content_async(prompt_parts) response = await model.generate_content_async(prompt_parts)
except ( except (
ClientError, GoogleAPICallError,
ValueError, ValueError,
genai_types.BlockedPromptException, genai_types.BlockedPromptException,
genai_types.StopCandidateException, genai_types.StopCandidateException,