mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix: add missing Dict/Optional imports in ChatGPT streaming_utils
Fixes NameError at runtime when ChatGPTToolCallNormalizer is instantiated. The imports were missed when type hints were changed from Python 3.10+ syntax (dict[], str | None) to typing module syntax (Dict[], Optional[str]).
This commit is contained in:
parent
7ab46104e2
commit
5495003e60
2 changed files with 2 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ Streaming utilities for ChatGPT provider.
|
|||
Normalizes non-spec-compliant tool_call chunks from the ChatGPT backend API.
|
||||
"""
|
||||
|
||||
from typing import Any
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
|
||||
class ChatGPTToolCallNormalizer:
|
||||
|
|
|
|||
|
|
@ -1274,6 +1274,7 @@ def test_usage_chunk_after_finish_reason_updates_hidden_params(logging_obj):
|
|||
assert hidden_usage.completion_tokens == 135, (
|
||||
f"Expected completion_tokens=135 from provider, got {hidden_usage.completion_tokens}"
|
||||
)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_custom_stream_wrapper_aclose():
|
||||
"""Test that aclose() delegates to the underlying completion_stream's aclose()"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue