mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
add transform_response_api_response
This commit is contained in:
parent
eafc1be132
commit
dff8308e92
2 changed files with 14 additions and 7 deletions
|
|
@ -2,10 +2,13 @@ import types
|
|||
from abc import ABC, abstractmethod
|
||||
from typing import TYPE_CHECKING, Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from litellm.types.llms.openai import (
|
||||
ResponseInputParam,
|
||||
ResponsesAPIOptionalRequestParams,
|
||||
ResponsesAPIRequestParams,
|
||||
ResponsesAPIResponse,
|
||||
)
|
||||
from litellm.types.router import GenericLiteLLMParams
|
||||
from litellm.types.utils import ModelInfo
|
||||
|
|
@ -85,7 +88,7 @@ class BaseResponsesAPIConfig(ABC):
|
|||
return api_base
|
||||
|
||||
@abstractmethod
|
||||
def transform_request(
|
||||
def transform_responses_api_request(
|
||||
self,
|
||||
model: str,
|
||||
input: Union[str, ResponseInputParam],
|
||||
|
|
@ -95,8 +98,12 @@ class BaseResponsesAPIConfig(ABC):
|
|||
) -> ResponsesAPIRequestParams:
|
||||
pass
|
||||
|
||||
# @abstractmethod
|
||||
# def transform_response(
|
||||
# self,
|
||||
# ):
|
||||
# pass
|
||||
@abstractmethod
|
||||
def transform_response_api_response(
|
||||
self,
|
||||
model: str,
|
||||
raw_response: httpx.Response,
|
||||
model_response: ResponsesAPIResponse,
|
||||
logging_obj: LiteLLMLoggingObj,
|
||||
) -> ResponsesAPIResponse:
|
||||
return model_response
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class OpenAIResponsesAPIConfig(BaseResponsesAPIConfig):
|
|||
timeout=optional_params.get("timeout"),
|
||||
)
|
||||
|
||||
def transform_request(
|
||||
def transform_responses_api_request(
|
||||
self,
|
||||
model: str,
|
||||
input: Union[str, ResponseInputParam],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue