From 2fabff06c0c2f445620c09942388f5fb07fbbb38 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 23 Mar 2024 16:02:15 -0700 Subject: [PATCH] fix(bedrock.py): fix supported openai params for bedrock claude 3 --- litellm/llms/bedrock.py | 10 +++++++++- litellm/tests/test_bedrock_completion.py | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/litellm/llms/bedrock.py b/litellm/llms/bedrock.py index 8f91ecc26e5..eab9b0cada5 100644 --- a/litellm/llms/bedrock.py +++ b/litellm/llms/bedrock.py @@ -129,7 +129,15 @@ class AmazonAnthropicClaude3Config: } def get_supported_openai_params(self): - return ["max_tokens", "tools", "tool_choice", "stream"] + return [ + "max_tokens", + "tools", + "tool_choice", + "stream", + "stop", + "temperature", + "top_p", + ] def map_openai_params(self, non_default_params: dict, optional_params: dict): for param, value in non_default_params.items(): diff --git a/litellm/tests/test_bedrock_completion.py b/litellm/tests/test_bedrock_completion.py index 8284b051586..6827bc570c3 100644 --- a/litellm/tests/test_bedrock_completion.py +++ b/litellm/tests/test_bedrock_completion.py @@ -214,6 +214,7 @@ def test_bedrock_claude_3(): model="bedrock/anthropic.claude-3-sonnet-20240229-v1:0", messages=messages, max_tokens=10, + temperature=0.78, ) # Add any assertions here to check the response assert len(response.choices) > 0