fix(base_aws_llm.py): fix credential caching check to see if token is set

This commit is contained in:
Krrish Dholakia 2024-09-14 17:45:18 -07:00
parent 3f08382591
commit 13dfe1f203

View file

@ -243,7 +243,10 @@ class BaseAWSLLM(BaseLLM):
credentials = session.get_credentials()
self.iam_cache.set_cache(cache_key, credentials, ttl=3600 - 60)
if (
credentials.token is None
): # don't cache if session token exists. The expiry time for that is not known.
self.iam_cache.set_cache(cache_key, credentials, ttl=3600 - 60)
return credentials