fix mypy issues:

This commit is contained in:
Sameer Kankute
2026-02-23 18:28:42 +05:30
parent 57af8e6a93
commit 88cd0d31ed
@@ -6,7 +6,17 @@ import logging
import threading
import time
import traceback
from typing import Any, AsyncIterator, Callable, Dict, Iterator, List, Optional, Union, cast
from typing import (
Any,
AsyncIterator,
Callable,
Dict,
Iterator,
List,
Optional,
Union,
cast,
)
import anyio
import httpx
@@ -1748,7 +1758,7 @@ class CustomStreamWrapper:
chunk = next(self.completion_stream)
if chunk is not None and chunk != b"":
print_verbose(
f"PROCESSED CHUNK PRE CHUNK CREATOR: {chunk}; custom_llm_provider: {self.custom_llm_provider}"
f"PROCESSED CHUNK PRE CHUNK CREATOR: {chunk.decode('utf-8', errors='replace') if isinstance(chunk, bytes) else chunk}; custom_llm_provider: {self.custom_llm_provider}"
)
response: Optional[ModelResponseStream] = self.chunk_creator(
chunk=chunk
@@ -1996,9 +2006,7 @@ class CustomStreamWrapper:
else:
chunk = next(self.completion_stream)
if chunk is not None and chunk != b"":
processed_chunk: Optional[
ModelResponseStream
] = self.chunk_creator(chunk=chunk)
processed_chunk = self.chunk_creator(chunk=chunk)
if processed_chunk is None:
continue