Files
crewAI/lib
Greyson LaLonde 41403c09b4 fix: re-read Gemini env vars in lazy client build
`_normalize_gemini_fields` captures `GOOGLE_API_KEY` / `GEMINI_API_KEY`
/ `GOOGLE_CLOUD_PROJECT` at construction time, so an LLM constructed
before deployment env vars are set would freeze `self.api_key = None`
and the lazy `_get_sync_client` build would then always auth-fail.

Re-read the env vars inside `_get_sync_client` when `self._client` is
None and the corresponding field is still unset, matching the pattern
used for the other native providers.

Add a regression test that constructs `GeminiCompletion` with no env
vars set, patches them in afterwards, and asserts the lazy build
succeeds and writes the resolved key back onto the LLM.
2026-04-12 05:03:51 +08:00
..
2026-04-10 21:51:51 +08:00