mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
* fix(security): hash the publicly known master key Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs: replace weak master key examples and regenerate artifacts Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: replace weak key fixtures with generated test keys Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci: generate master keys for proxy startup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: preserve lens dev key entropy Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: restore proxy key compatibility in scrub examples Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix: scrub merged SSO fixture and refresh dashboard bundle Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(ci): stabilize test keys and metadata collection Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore: drop the rebuilt dashboard bundle Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: mateo <mateo@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
29 lines
901 B
Python
29 lines
901 B
Python
import os
|
|
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=os.environ["LITELLM_MASTER_KEY"],
|
|
)
|
|
|
|
|
|
class TestAnthropicMessagesEndpoint(BaseAnthropicMessagesTest):
|
|
def get_client(self):
|
|
return anthropic.Anthropic(
|
|
base_url="http://0.0.0.0:4000",
|
|
api_key=os.environ["LITELLM_MASTER_KEY"],
|
|
)
|
|
|
|
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)
|