mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
[Fix] Update deprecated claude-3-5-haiku-latest model refs and fix langfuse router test
Replace claude-3-5-haiku-latest with claude-haiku-4-5-20251001 in tests that make actual API calls. Fix test_langfuse_logging_with_router by aggregating batch items from all HTTP calls instead of only the last one. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8787d40dcf
commit
3b0a64ce9d
3 changed files with 20 additions and 11 deletions
|
|
@ -181,7 +181,7 @@ async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_streaming(s
|
|||
# litellm._turn_on_debug()
|
||||
async_client = AsyncHTTPHandler()
|
||||
response = await litellm.acompletion(
|
||||
model="anthropic/claude-3-5-haiku-latest",
|
||||
model="anthropic/claude-haiku-4-5-20251001",
|
||||
messages=[{"role": "user", "content": "what is litellm?"}],
|
||||
vector_store_ids = [
|
||||
"T37J8R4WTM"
|
||||
|
|
@ -232,7 +232,7 @@ async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_with_tools(
|
|||
# Init client
|
||||
litellm._turn_on_debug()
|
||||
response = await litellm.acompletion(
|
||||
model="anthropic/claude-3-5-haiku-latest",
|
||||
model="anthropic/claude-haiku-4-5-20251001",
|
||||
messages=[{"role": "user", "content": "what is litellm?"}],
|
||||
max_tokens=10,
|
||||
tools=[
|
||||
|
|
@ -255,7 +255,7 @@ async def test_e2e_bedrock_knowledgebase_retrieval_with_llm_api_call_with_tools_
|
|||
litellm._turn_on_debug()
|
||||
|
||||
response = await litellm.acompletion(
|
||||
model="anthropic/claude-3-5-haiku-latest",
|
||||
model="anthropic/claude-haiku-4-5-20251001",
|
||||
messages=[{"role": "user", "content": "what is litellm?"}],
|
||||
max_tokens=10,
|
||||
tools=[
|
||||
|
|
@ -350,7 +350,7 @@ async def test_bedrock_kb_request_body_has_transformed_filters(setup_vector_stor
|
|||
new=AsyncMock(side_effect=fake_async_vector_store_search_handler),
|
||||
):
|
||||
response = await litellm.acompletion(
|
||||
model="anthropic/claude-3-5-haiku-latest",
|
||||
model="anthropic/claude-haiku-4-5-20251001",
|
||||
messages=[{"role": "user", "content": "what is litellm?"}],
|
||||
max_tokens=10,
|
||||
tools=[
|
||||
|
|
|
|||
|
|
@ -149,17 +149,26 @@ class TestLangfuseLogging:
|
|||
|
||||
# Verify the call
|
||||
assert mock_post.call_count >= 1
|
||||
url = mock_post.call_args[0][0]
|
||||
request_body = mock_post.call_args[1].get("content")
|
||||
|
||||
# Parse the JSON string into a dict for assertions
|
||||
actual_request_body = json.loads(request_body)
|
||||
# Aggregate batch items from ALL calls (langfuse may split trace-create
|
||||
# and generation-create across separate HTTP requests)
|
||||
all_batch_items = []
|
||||
last_metadata = None
|
||||
for call in mock_post.call_args_list:
|
||||
url = call[0][0]
|
||||
assert url == "https://us.cloud.langfuse.com/api/public/ingestion"
|
||||
body = json.loads(call[1].get("content"))
|
||||
all_batch_items.extend(body.get("batch", []))
|
||||
last_metadata = body.get("metadata", last_metadata)
|
||||
|
||||
actual_request_body = {
|
||||
"batch": all_batch_items,
|
||||
"metadata": last_metadata,
|
||||
}
|
||||
|
||||
print("\nMocked Request Details:")
|
||||
print(f"URL: {url}")
|
||||
print(f"Request Body: {json.dumps(actual_request_body, indent=4)}")
|
||||
|
||||
assert url == "https://us.cloud.langfuse.com/api/public/ingestion"
|
||||
assert_langfuse_request_matches_expected(
|
||||
actual_request_body,
|
||||
expected_file_name,
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ def test_anthropic_web_search_in_model_info():
|
|||
"anthropic/claude-sonnet-4-5-20250929",
|
||||
"anthropic/claude-3-5-sonnet-20241022",
|
||||
"anthropic/claude-3-5-haiku-20241022",
|
||||
"anthropic/claude-3-5-haiku-latest",
|
||||
"anthropic/claude-haiku-4-5-20251001",
|
||||
]
|
||||
for model in supported_models:
|
||||
from litellm.utils import get_model_info
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue