Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

parse_jsonl_with_embedded_newlines

Ishaan Jaffer21757af83d92
diff --git a/litellm/router_utils/batch_utils.py b/litellm/router_utils/batch_utils.py
index 0baad322fa9..aef8f5cc012 100644
--- a/litellm/router_utils/batch_utils.py
+++ b/litellm/router_utils/batch_utils.py
@@ -1,7 +1,7 @@
import io
import json
from os import PathLike
-from typing import Optional
+from typing import List, Optional
from litellm._logging import verbose_logger
from litellm.types.llms.openai import FileTypes, OpenAIFilesPurpose
@@ -16,7 +16,7 @@ class InMemoryFile(io.BytesIO):
self.content_type = content_type
-def parse_jsonl_with_embedded_newlines(content: str) -> list[dict]:
+def parse_jsonl_with_embedded_newlines(content: str) -> List[dict]:
"""
Parse JSONL content that may contain JSON objects with embedded newlines in string values.