From 5e981acc087a4042129e6aeb8df79149b05bcf53 Mon Sep 17 00:00:00 2001 From: mateo Date: Sun, 18 Oct 2026 01:29:02 +0000 Subject: [PATCH] fix(types): revert pegasus response validation to main Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../amazon_twelvelabs_pegasus_transformation.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/litellm/llms/bedrock/chat/invoke_transformations/amazon_twelvelabs_pegasus_transformation.py b/litellm/llms/bedrock/chat/invoke_transformations/amazon_twelvelabs_pegasus_transformation.py index 6938c151b88..f7566ac4923 100644 --- a/litellm/llms/bedrock/chat/invoke_transformations/amazon_twelvelabs_pegasus_transformation.py +++ b/litellm/llms/bedrock/chat/invoke_transformations/amazon_twelvelabs_pegasus_transformation.py @@ -10,8 +10,6 @@ import time from typing import TYPE_CHECKING, Any, Final import httpx -from pydantic import ConfigDict, TypeAdapter, with_config -from typing_extensions import NotRequired, ReadOnly, TypedDict import litellm from litellm._logging import verbose_logger @@ -36,15 +34,6 @@ else: LiteLLMLoggingObj = Any -@with_config(ConfigDict(extra="allow", strict=True)) -class _PegasusResponse(TypedDict): - message: NotRequired[ReadOnly[str | None]] - finishReason: NotRequired[ReadOnly[str]] - - -_PEGASUS_RESPONSE: Final = TypeAdapter(_PegasusResponse) - - class AmazonTwelveLabsPegasusConfig(AmazonInvokeConfig, BaseConfig): """ Handles transforming OpenAI-style requests into Bedrock InvokeModel requests for @@ -218,7 +207,7 @@ class AmazonTwelveLabsPegasusConfig(AmazonInvokeConfig, BaseConfig): ModelResponse with choices[0].message.content and finish_reason """ try: - raw_completion_response: Final = raw_response.json() + completion_response: Final = raw_response.json() except Exception as e: raise BedrockError( message=f"Error parsing response: {raw_response.text}, error: {e}", @@ -226,8 +215,6 @@ class AmazonTwelveLabsPegasusConfig(AmazonInvokeConfig, BaseConfig): headers=raw_response.headers, ) - completion_response: Final = _PEGASUS_RESPONSE.validate_python(raw_completion_response) - verbose_logger.debug( "twelvelabs pegasus response: %s", json.dumps(completion_response, indent=4, default=str),