mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-28 04:19:59 +00:00
fix(tests): use litellm.anthropic_messages entrypoint + drop unstable openapi field
Two CI failures, both pre-existing in different ways:
1. reasoning_effort_grid: all 33 bedrock_invoke_messages cells failed with
AttributeError("module 'litellm' has no attribute 'messages'"). litellm
exposes the async Anthropic Messages entrypoint as litellm.anthropic_messages
(via "from .llms.anthropic.experimental_pass_through.messages.handler
import *" in litellm/__init__.py), not litellm.messages.acreate. Swap
the call.
2. tests/test_litellm/interactions/test_openapi_compliance.py::TestResponseCompliance::test_interaction_response_fields
asserts the live Google spec contains "steps". Google's spec has churned
through "outputs" -> "steps" -> neither, and presently carries neither.
The test broke on main as soon as upstream dropped "steps"; pulling the
key off the assert list realigns the test with the live schema. Re-add
the per-turn output field once upstream stabilizes on a name.
The openapi-compliance fix doesn't belong to this PR conceptually but is
included here per request to unblock CI before the morning.
This commit is contained in:
@@ -172,7 +172,7 @@ async def _call_messages(
|
||||
) -> Tuple[int, Optional[Exception]]:
|
||||
kwargs = _build_messages_kwargs(model, effort)
|
||||
try:
|
||||
await litellm.messages.acreate(**kwargs)
|
||||
await litellm.anthropic_messages(**kwargs)
|
||||
return 200, None
|
||||
except BadRequestError as exc:
|
||||
return 400, exc
|
||||
|
||||
@@ -157,15 +157,17 @@ class TestResponseCompliance:
|
||||
# Check CreateModelInteractionParams which includes output fields
|
||||
schema = spec_dict["components"]["schemas"]["CreateModelInteractionParams"]
|
||||
|
||||
# Output fields (readOnly). Google renamed `outputs` → `steps` in the
|
||||
# upstream spec; keep this list aligned with the live schema.
|
||||
# Output fields (readOnly). Google's live spec has churned through
|
||||
# both `outputs` and `steps` for the per-turn output array and at the
|
||||
# moment carries neither -- only the stable response-level fields
|
||||
# below are guaranteed. Re-add the per-turn key once upstream
|
||||
# stabilizes on a name.
|
||||
output_fields = [
|
||||
"id",
|
||||
"status",
|
||||
"created",
|
||||
"updated",
|
||||
"role",
|
||||
"steps",
|
||||
"usage",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user