File tree 1 file changed +6
-4
lines changed
src/seer/automation/agent
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 17
17
ToolUseBlockParam ,
18
18
)
19
19
from google import genai # type: ignore[attr-defined]
20
- from google .genai .errors import ClientError , ServerError # Add ServerError import
20
+ from google .genai .errors import ClientError , ServerError
21
21
from google .genai .types import (
22
22
Content ,
23
23
FunctionDeclaration ,
@@ -843,9 +843,11 @@ def is_completion_exception_retryable(exception: Exception) -> bool:
843
843
"Internal error" ,
844
844
)
845
845
return (
846
- isinstance (exception , ServerError ) or # Always retry server errors
847
- (isinstance (exception , ClientError ) and
848
- any (error in str (exception ) for error in retryable_errors ))
846
+ isinstance (exception , ServerError )
847
+ or (
848
+ isinstance (exception , ClientError )
849
+ and any (error in str (exception ) for error in retryable_errors )
850
+ )
849
851
) or isinstance (exception , LlmStreamTimeoutError )
850
852
851
853
@observe (as_type = "generation" , name = "Gemini Generation" )
You can’t perform that action at this time.
0 commit comments