diff --git a/litellm/integrations/rubrik.py b/litellm/integrations/rubrik.py index 485389b8b39..34639cee9f8 100644 --- a/litellm/integrations/rubrik.py +++ b/litellm/integrations/rubrik.py @@ -34,7 +34,7 @@ if TYPE_CHECKING: Logging as LiteLLMLoggingObj, ) -_ENDPOINT_ANTHROPIC_MESSAGES = "/messages" +_ENDPOINT_ANTHROPIC_MESSAGES = "/v1/messages" _WEBHOOK_PATH_TOOL_BLOCKING = "/v1/after_completion/openai/v1" _WEBHOOK_PATH_LOGGING_BATCH = "/v1/litellm/batch" diff --git a/litellm/llms/chatgpt/responses/transformation.py b/litellm/llms/chatgpt/responses/transformation.py index 828c46ca398..e0b5b7ac65e 100644 --- a/litellm/llms/chatgpt/responses/transformation.py +++ b/litellm/llms/chatgpt/responses/transformation.py @@ -167,8 +167,6 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): parsed_chunk = self._parse_sse_json_chunk(chunk) if parsed_chunk is None: continue - if parsed_chunk == STREAM_SSE_DONE_STRING: - break event_type = parsed_chunk.get("type") if event_type == ResponsesAPIStreamEvents.OUTPUT_ITEM_DONE: @@ -209,7 +207,7 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): return completed_response, error_message - def _parse_sse_json_chunk(self, chunk: str) -> Optional[Any]: + def _parse_sse_json_chunk(self, chunk: str) -> Optional[Dict[str, Any]]: # Strip outer whitespace before removing the SSE `data:` prefix. # `_strip_sse_data_from_chunk` only matches the prefix at position 0, # so chunks with leading whitespace (e.g. ` data: {...}`) would @@ -218,10 +216,8 @@ class ChatGPTResponsesAPIConfig(OpenAIResponsesAPIConfig): if not stripped_chunk: return None stripped_chunk = stripped_chunk.strip() - if not stripped_chunk: + if not stripped_chunk or stripped_chunk == STREAM_SSE_DONE_STRING: return None - if stripped_chunk == STREAM_SSE_DONE_STRING: - return STREAM_SSE_DONE_STRING try: parsed_chunk = json.loads(stripped_chunk) except json.JSONDecodeError: