Skip to content

Commit 44b3a85

Browse files
Merge branch 'BerriAI:main' into dev1206
2 parents 1ae1ae8 + 60a325e commit 44b3a85

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

docs/my-website/docs/proxy/config_settings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,8 @@ router_settings:
739739
| OPENMETER_API_ENDPOINT | API endpoint for OpenMeter integration
740740
| OPENMETER_API_KEY | API key for OpenMeter services
741741
| OPENMETER_EVENT_TYPE | Type of events sent to OpenMeter
742+
| ONYX_API_BASE | Base URL for Onyx Security AI Guard service (defaults to https://ai-guard.onyx.security)
743+
| ONYX_API_KEY | API key for Onyx Security AI Guard service
742744
| OTEL_ENDPOINT | OpenTelemetry endpoint for traces
743745
| OTEL_EXPORTER_OTLP_ENDPOINT | OpenTelemetry endpoint for traces
744746
| OTEL_ENVIRONMENT_NAME | Environment name for OpenTelemetry

litellm/llms/anthropic/chat/handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ def _handle_message_delta(self, chunk: dict) -> Tuple[str, Optional[Usage]]:
874874

875875
def _handle_accumulated_json_chunk(
876876
self, data_str: str
877-
) -> Optional[GenericStreamingChunk]:
877+
) -> Optional[ModelResponseStream]:
878878
"""
879879
Handle partial JSON chunks by accumulating them until valid JSON is received.
880880
@@ -885,7 +885,7 @@ def _handle_accumulated_json_chunk(
885885
data_str: The JSON string to parse (without "data:" prefix)
886886
887887
Returns:
888-
GenericStreamingChunk if JSON is complete, None if still accumulating
888+
ModelResponseStream if JSON is complete, None if still accumulating
889889
"""
890890
# Accumulate JSON data
891891
self.accumulated_json += data_str
@@ -899,15 +899,15 @@ def _handle_accumulated_json_chunk(
899899
# If it's not valid JSON yet, continue to the next chunk
900900
return None
901901

902-
def _parse_sse_data(self, str_line: str) -> Optional[GenericStreamingChunk]:
902+
def _parse_sse_data(self, str_line: str) -> Optional[ModelResponseStream]:
903903
"""
904904
Parse SSE data line, handling both complete and partial JSON chunks.
905905
906906
Args:
907907
str_line: The SSE line starting with "data:"
908908
909909
Returns:
910-
GenericStreamingChunk if parsing succeeded, None if accumulating partial JSON
910+
ModelResponseStream if parsing succeeded, None if accumulating partial JSON
911911
"""
912912
data_str = str_line[5:] # Remove "data:" prefix
913913

litellm/proxy/response_polling/background_streaming.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"""
1010
import asyncio
1111
import json
12+
from typing import Any, Dict
1213

1314
from fastapi import Request, Response
1415

@@ -85,7 +86,7 @@ async def background_streaming_task( # noqa: PLR0915
8586

8687
# Process streaming response following OpenAI events format
8788
# https://platform.openai.com/docs/api-reference/responses-streaming
88-
output_items = {} # Track output items by ID
89+
output_items: Dict[str, Dict[str, Any]] = {} # Track output items by ID
8990
accumulated_text = {} # Track accumulated text deltas by (item_id, content_index)
9091

9192
# ResponsesAPIResponse fields to extract from response.completed

0 commit comments

Comments
 (0)