mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-18 00:48:01 +00:00
29 lines
845 B
Python
29 lines
845 B
Python
from base_anthropic_messages_test import BaseAnthropicMessagesTest
|
|
import anthropic
|
|
|
|
|
|
class TestAnthropicPassthroughBasic(BaseAnthropicMessagesTest):
|
|
|
|
def get_client(self):
|
|
return anthropic.Anthropic(
|
|
base_url="http://0.0.0.0:4000/anthropic",
|
|
api_key="sk-1234",
|
|
)
|
|
|
|
|
|
class TestAnthropicMessagesEndpoint(BaseAnthropicMessagesTest):
|
|
def get_client(self):
|
|
return anthropic.Anthropic(
|
|
base_url="http://0.0.0.0:4000",
|
|
api_key="sk-1234",
|
|
)
|
|
|
|
def test_anthropic_messages_to_wildcard_model(self):
|
|
client = self.get_client()
|
|
response = client.messages.create(
|
|
model="anthropic/claude-haiku-4-5-20251001",
|
|
messages=[{"role": "user", "content": "Hello, world!"}],
|
|
max_tokens=100,
|
|
)
|
|
print(response)
|