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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
add OpenAIResponsesAPIConfig
Ishaan Jaff6462466e020f
diff --git a/litellm/llms/base_llm/responses/transformation.py b/litellm/llms/base_llm/responses/transformation.pynew file mode 100644index 00000000000..d80deed29c0--- /dev/null+++ b/litellm/llms/base_llm/responses/transformation.py@@ -0,0 +1,97 @@+import types+from abc import ABC, abstractmethod+from typing import TYPE_CHECKING, Any, Optional++from litellm.types.utils import ModelInfo++from ..chat.transformation import BaseLLMException++if TYPE_CHECKING:+ from litellm.litellm_core_utils.litellm_logging import Logging as _LiteLLMLoggingObj++ LiteLLMLoggingObj = _LiteLLMLoggingObj+else:+ LiteLLMLoggingObj = Any+++class BaseResponsesAPIConfig(ABC):+ def __init__(self):+ pass++ @classmethod+ def get_config(cls):+ return {+ k: v+ for k, v in cls.__dict__.items()+ if not k.startswith("__")+ and not k.startswith("_abc")+ and not isinstance(+ v,+ (+ types.FunctionType,+ types.BuiltinFunctionType,+ classmethod,+ staticmethod,+ ),+ )+ and v is not None+ }++ @abstractmethod+ def get_supported_openai_params(self, model: str) -> list:+ pass++ @abstractmethod+ def map_openai_params(+ self,+ non_default_params: dict,+ optional_params: dict,+ model: str,+ drop_params: bool,+ ) -> dict:+ pass++ @abstractmethod+ def validate_environment(+ self,+ headers: dict,+ model: str,+ optional_params: dict,+ api_key: Optional[str] = None,+ api_base: Optional[str] = None,+ ) -> dict:+ pass++ def get_complete_url(+ self,+ api_base: Optional[str],+ model: str,+ optional_params: dict,+ stream: Optional[bool] = None,+ ) -> str:+ """+ OPTIONAL++ Get the complete url for the request++ Some providers need `model` in `api_base`+ """+ if api_base is None:+ raise ValueError("api_base is required")+ return api_base++ @abstractmethod+ def transform_request(+ self,+ model: str,+ optional_params: dict,+ litellm_params: dict,+ headers: dict,+ ) -> dict:+ pass++ @abstractmethod+ def transform_response(+ self,+ ):+ pass