fix(llm-gateway): improve type safety and datetime consistency
- Add type annotations for mypy compliance - Use UTC-aware datetimes consistently (datetime.now(UTC)) - Add type: ignore comments for LiteLLM incomplete stubs - Fix import ordering and formatting - Update pyproject.toml mypy configuration 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,6 +110,7 @@ class TestWrapLiteLLMStream:
|
||||
|
||||
async def test_wrap_stream_basic(self) -> None:
|
||||
"""Test wrapping a basic stream."""
|
||||
|
||||
# Create mock stream chunks
|
||||
async def mock_stream():
|
||||
chunk1 = MagicMock()
|
||||
@@ -146,6 +147,7 @@ class TestWrapLiteLLMStream:
|
||||
|
||||
async def test_wrap_stream_without_accumulator(self) -> None:
|
||||
"""Test wrapping stream without accumulator."""
|
||||
|
||||
async def mock_stream():
|
||||
chunk = MagicMock()
|
||||
chunk.choices = [MagicMock()]
|
||||
@@ -284,6 +286,7 @@ class TestStreamToString:
|
||||
|
||||
async def test_stream_to_string_basic(self) -> None:
|
||||
"""Test converting stream to string."""
|
||||
|
||||
async def mock_stream():
|
||||
yield StreamChunk(id="1", delta="Hello")
|
||||
yield StreamChunk(id="2", delta=" ")
|
||||
@@ -303,6 +306,7 @@ class TestStreamToString:
|
||||
|
||||
async def test_stream_to_string_no_usage(self) -> None:
|
||||
"""Test stream without usage stats."""
|
||||
|
||||
async def mock_stream():
|
||||
yield StreamChunk(id="1", delta="Test")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user