We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d842dc commit 2f5b51eCopy full SHA for 2f5b51e
src/agents/llm_factory.py
@@ -79,8 +79,13 @@ def __init__(self, temperature: int = 0):
79
model=os.environ['GOOGLE_AI_MODEL'],
80
temperature=temperature,
81
google_api_key=os.environ['GOOGLE_AI_API_KEY'],
82
- max_retries=0,
+ )
83
+
84
+ # This wrapper will catch errors and retry the call itself.
85
+ # It does NOT pass 'max_retries' to the underlying model.
86
+ self._google_llm_with_retries = self._google_llm.with_retry(
87
+ stop_after_attempt=1, # Corresponds to max_retries
88
)
89
90
def get_llm(self):
- return self._google_llm
91
+ return self._google_llm_with_retries
0 commit comments