mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
style: drop redundant comment and add Final on #45470 regression test
Address greptile review on PR #45478: remove explanatory comments and annotate new test locals with Final per AGENTS.md.
This commit is contained in:
parent
827f0c2a07
commit
f237a9fac4
2 changed files with 3 additions and 5 deletions
|
|
@ -210,8 +210,6 @@ class LiteLLMAnthropicToResponsesAPIAdapter:
|
|||
},
|
||||
)
|
||||
if btype == "text":
|
||||
# Emit text in block order so text before/after tool_use is not
|
||||
# replayed as one trailing assistant message (#45470).
|
||||
return (
|
||||
{
|
||||
"type": "message",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Tests for LiteLLMAnthropicToResponsesAPIAdapter
|
|||
|
||||
import json
|
||||
import os
|
||||
from typing import Any, Dict, List
|
||||
from typing import Any, Dict, Final, List
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
|
@ -668,7 +668,7 @@ class TestTranslateMessagesToResponsesInput:
|
|||
|
||||
def test_assistant_text_before_and_after_tool_use_preserves_order(self):
|
||||
"""Text around tool_use stays in block order, not replayed after (#45470)."""
|
||||
messages = [
|
||||
messages: Final = [
|
||||
{"role": "user", "content": "weather in Paris?"},
|
||||
{
|
||||
"role": "assistant",
|
||||
|
|
@ -690,7 +690,7 @@ class TestTranslateMessagesToResponsesInput:
|
|||
],
|
||||
},
|
||||
]
|
||||
result = _translate_messages(messages)
|
||||
result: Final = _translate_messages(messages)
|
||||
assert [item["type"] for item in result] == [
|
||||
"message",
|
||||
"message",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue