mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(main.py): accept vertex service account credentials as json string
allows us to dynamically set vertex ai credentials
This commit is contained in:
parent
c769c3f39b
commit
50081479f9
3 changed files with 71 additions and 15 deletions
|
@ -1678,6 +1678,11 @@ def completion(
|
|||
)
|
||||
|
||||
if "claude-3" in model:
|
||||
vertex_credentials = (
|
||||
optional_params.pop("vertex_credentials", None)
|
||||
or optional_params.pop("vertex_ai_credentials", None)
|
||||
or get_secret("VERTEXAI_CREDENTIALS")
|
||||
)
|
||||
model_response = vertex_ai_anthropic.completion(
|
||||
model=model,
|
||||
messages=messages,
|
||||
|
@ -1689,6 +1694,7 @@ def completion(
|
|||
encoding=encoding,
|
||||
vertex_location=vertex_ai_location,
|
||||
vertex_project=vertex_ai_project,
|
||||
vertex_credentials=vertex_credentials,
|
||||
logging_obj=logging,
|
||||
acompletion=acompletion,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue