feat(vertex_ai_anthropic.py): support response_schema for vertex ai anthropic calls

allows passing response_schema for anthropic calls. supports schema validation.
This commit is contained in:
Krrish Dholakia 2024-07-18 16:57:38 -07:00
parent 432b7ae264
commit aac912d3f8
6 changed files with 189 additions and 48 deletions

View file

@ -1528,6 +1528,8 @@ def completion(
api_key=api_key,
logging_obj=logging,
headers=headers,
timeout=timeout,
client=client,
)
if optional_params.get("stream", False) or acompletion == True:
## LOGGING
@ -2046,7 +2048,10 @@ def completion(
acompletion=acompletion,
headers=headers,
custom_prompt_dict=custom_prompt_dict,
timeout=timeout,
client=client,
)
else:
model_response = vertex_ai.completion(
model=model,