Merge pull request #4989 from ec2ainun/fix/proxy-vertex-path

fix: support vertex filepath on proxy litellm_params definition
This commit is contained in:
Ishaan Jaff 2024-08-01 09:15:24 -07:00 committed by GitHub
commit 34838a29f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -790,7 +790,10 @@ class VertexLLM(BaseLLM):
if credentials is not None and isinstance(credentials, str):
import google.oauth2.service_account
json_obj = json.loads(credentials)
if os.path.exists(credentials):
json_obj = json.load(open(credentials))
else:
json_obj = json.loads(credentials)
creds = google.oauth2.service_account.Credentials.from_service_account_info(
json_obj,