From 6a28d0f88251c53d64c93e62158359d3faccad65 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 4 Mar 2024 21:39:12 -0800 Subject: [PATCH] (fix) claude-instant-1 test --- litellm/llms/anthropic_text.py | 6 ++++-- litellm/tests/test_completion.py | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/litellm/llms/anthropic_text.py b/litellm/llms/anthropic_text.py index e9d504d36..bccc8c769 100644 --- a/litellm/llms/anthropic_text.py +++ b/litellm/llms/anthropic_text.py @@ -35,7 +35,9 @@ class AnthropicTextConfig: to pass metadata to anthropic, it's {"user_id": "any-relevant-information"} """ - max_tokens: Optional[int] = litellm.max_tokens # anthropic requires a default + max_tokens_to_sample: Optional[int] = ( + litellm.max_tokens + ) # anthropic requires a default stop_sequences: Optional[list] = None temperature: Optional[int] = None top_p: Optional[int] = None @@ -44,7 +46,7 @@ class AnthropicTextConfig: def __init__( self, - max_tokens: Optional[int] = 256, # anthropic requires a default + max_tokens_to_sample: Optional[int] = 256, # anthropic requires a default stop_sequences: Optional[list] = None, temperature: Optional[int] = None, top_p: Optional[int] = None, diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index c93c816ce..22d8b2f6a 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -56,7 +56,7 @@ def test_completion_custom_provider_model_name(): def test_completion_claude(): litellm.set_verbose = True litellm.cache = None - litellm.AnthropicTextConfig(max_tokens=200, metadata={"user_id": "1224"}) + litellm.AnthropicTextConfig(max_tokens_to_sample=200, metadata={"user_id": "1224"}) messages = [ { "role": "system", @@ -67,10 +67,7 @@ def test_completion_claude(): try: # test without max tokens response = completion( - model="claude-instant-1.2", - messages=messages, - request_timeout=10, - max_tokens=10, + model="claude-instant-1", messages=messages, request_timeout=10 ) # Add any assertions, here to check response args print(response)