- Notifications
You must be signed in to change notification settings - Fork1k
Bugfix: avoid race condition when refreshing google token#2100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@JadHADDAD92 Thanks Jad. This look like the same issue as#1440. There, my colleague Marcelo this should be solved with the new Note that this PR may still make sense, but I want to verify the new classes also work for you. |
I have tried classInformationExtractionAgent:def__init__(self):credentials=service_account.Credentials.from_service_account_file(os.path.join("shared","config","gemini.json"),scopes=["https://www.googleapis.com/auth/cloud-platform"], )self.model=GoogleModel("gemini-2.5-pro",provider=GoogleProvider(credentials=credentials,location="europe-west1", ), )self.settings=GoogleModelSettings(google_thinking_config={"thinking_budget":128,"include_thoughts":True} ) And couldn't reproduce my error, so I guess it works! |
@JadHADDAD92 Glad to hear it! @Kludex What do you think, should we keep fixing issues in |
We should deprecate this model. |
46aa248
intopydantic:mainUh oh!
There was an error while loading.Please reload this page.
Hello,
I have been having an issue with the refresh token when launching multiple Gemini agents concurrently.
Here is a minimal reproducible code:
Class handling agent
This class is called and used from a coroutine
and this coroutine is called concurrently in a Semaphore
I would randomly get this error, not consistently, even though all the instances have the service_account_file configured to
shared/config/gemini.json
, seems like a race condition:with the help of Mert Sırakaya, here is a patch for this error, I have tried running the test many times after the patch, I don't have any errors, and then tried again without the patch and I occasionally got the error again.
For the typing lint I have put
ignore[reportUnknownMemberType]
comments because I didn't know what else to do, I'm open to better suggestions