(fix) claude-instant-1 test

This commit is contained in:
ishaan-jaff 2024-03-04 21:39:12 -08:00
parent 5cb854720f
commit 6a28d0f882
2 changed files with 6 additions and 7 deletions

View file

@ -35,7 +35,9 @@ class AnthropicTextConfig:
to pass metadata to anthropic, it's {"user_id": "any-relevant-information"} 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 stop_sequences: Optional[list] = None
temperature: Optional[int] = None temperature: Optional[int] = None
top_p: Optional[int] = None top_p: Optional[int] = None
@ -44,7 +46,7 @@ class AnthropicTextConfig:
def __init__( def __init__(
self, 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, stop_sequences: Optional[list] = None,
temperature: Optional[int] = None, temperature: Optional[int] = None,
top_p: Optional[int] = None, top_p: Optional[int] = None,

View file

@ -56,7 +56,7 @@ def test_completion_custom_provider_model_name():
def test_completion_claude(): def test_completion_claude():
litellm.set_verbose = True litellm.set_verbose = True
litellm.cache = None litellm.cache = None
litellm.AnthropicTextConfig(max_tokens=200, metadata={"user_id": "1224"}) litellm.AnthropicTextConfig(max_tokens_to_sample=200, metadata={"user_id": "1224"})
messages = [ messages = [
{ {
"role": "system", "role": "system",
@ -67,10 +67,7 @@ def test_completion_claude():
try: try:
# test without max tokens # test without max tokens
response = completion( response = completion(
model="claude-instant-1.2", model="claude-instant-1", messages=messages, request_timeout=10
messages=messages,
request_timeout=10,
max_tokens=10,
) )
# Add any assertions, here to check response args # Add any assertions, here to check response args
print(response) print(response)