nemo_evaluator.adapters.interceptors.endpoint_interceptor#

Endpoint interceptor that makes actual requests to the upstream API.

Module Contents#

Classes#

EndpointInterceptor

Makes the actual request to the upstream API.

API#

class nemo_evaluator.adapters.interceptors.endpoint_interceptor.EndpointInterceptor(params: Params)[source]#

Bases: nemo_evaluator.adapters.types.RequestToResponseInterceptor

Makes the actual request to the upstream API.

Initialization

Initialize the endpoint interceptor.

Args: params: Configuration parameters

class Params(/, **data: Any)[source]#

Bases: nemo_evaluator.logging.BaseLoggingParams

Configuration parameters for endpoint interceptor.

Initialization

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

intercept_request(
ar: nemo_evaluator.adapters.types.AdapterRequest,
context: nemo_evaluator.adapters.types.AdapterGlobalContext,
) nemo_evaluator.adapters.types.AdapterResponse[source]#

Make the actual request to the upstream API.

Args: ar: The adapter request context: Global context containing server-level configuration

Returns: AdapterResponse with the response from the upstream API