mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
Merge pull request #4199 from hawktang/main
support vertex_credentials filepath
This commit is contained in:
commit
df1a2ca5c2
1 changed files with 4 additions and 1 deletions
|
|
@ -238,7 +238,10 @@ def completion(
|
|||
if vertex_credentials is not None and isinstance(vertex_credentials, str):
|
||||
import google.oauth2.service_account
|
||||
|
||||
json_obj = json.loads(vertex_credentials)
|
||||
try:
|
||||
json_obj = json.loads(vertex_credentials)
|
||||
except json.JSONDecodeError:
|
||||
json_obj = json.load(open(vertex_credentials))
|
||||
|
||||
creds = (
|
||||
google.oauth2.service_account.Credentials.from_service_account_info(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue