mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(cost_calculator): robust handling of server_tool_use and fix linting
This commit is contained in:
parent
4fb3f74b92
commit
a6fb2ce071
2 changed files with 1 additions and 5 deletions
|
|
@ -1,7 +1,5 @@
|
|||
import sys
|
||||
import os
|
||||
from unittest.mock import MagicMock
|
||||
import pytest
|
||||
|
||||
# Add the project root to the path
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
|
||||
|
|
@ -40,9 +38,7 @@ def test_completion_cost_with_dict_usage():
|
|||
# This should not raise AttributeError
|
||||
cost = completion_cost(completion_response=response, model="gpt-3.5-turbo")
|
||||
assert cost is not None
|
||||
print(f"Cost calculated: {cost}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_usage_coercion_from_dict()
|
||||
test_completion_cost_with_dict_usage()
|
||||
print("Tests passed!")
|
||||
|
|
|
|||
|
|
@ -1264,7 +1264,7 @@ class Delta(SafeAttributeModel, OpenAIObject):
|
|||
reasoning_items: Optional[List[ChatCompletionReasoningItem]] = None
|
||||
provider_specific_fields: Optional[Dict[str, Any]] = Field(default=None)
|
||||
|
||||
def __init__(
|
||||
def __init__( # noqa: PLR0915
|
||||
self,
|
||||
content=None,
|
||||
role=None,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue