Codecs

Base64Codec

Codec that convers to / from a base64 input.

Methods

can_encode()

can_encode(payload: Any) -> bool

Evaluate whether the codec can encode (decode) the payload.

decode_input()

decode_input(request_input: RequestInput) -> List[bytes]

Decode a request input into a high-level Python type.

decode_output()

decode_output(response_output: ResponseOutput) -> List[bytes]

Decode a response output into a high-level Python type.

encode_input()

Encode the given payload into a RequestInput.

encode_output()

Encode the given payload into a response output.

CodecError

Methods

add_note()

Exception.add_note(note) -- add a note to the exception

with_traceback()

Exception.with_traceback(tb) -- set self.traceback to tb and return self.

DatetimeCodec

Codec that convers to / from a datetime input.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_input()

Decode a request input into a high-level Python type.

decode_output()

Decode a response output into a high-level Python type.

encode_input()

Encode the given payload into a RequestInput.

encode_output()

Encode the given payload into a response output.

InputCodec

The InputCodec interface lets you define type conversions of your raw input data to / from the Open Inference Protocol. Note that this codec applies at the individual input (output) level.

For request-wide transformations (e.g. dataframes), use the RequestCodec interface instead.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_input()

Decode a request input into a high-level Python type.

decode_output()

Decode a response output into a high-level Python type.

encode_input()

Encode the given payload into a RequestInput.

encode_output()

Encode the given payload into a response output.

NumpyCodec

Decodes an request input (response output) as a NumPy array.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_input()

Decode a request input into a high-level Python type.

decode_output()

Decode a response output into a high-level Python type.

encode_input()

Encode the given payload into a RequestInput.

encode_output()

Encode the given payload into a response output.

NumpyRequestCodec

Decodes the first input (output) of request (response) as a NumPy array. This codec can be useful for cases where the whole payload is a single NumPy tensor.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_request()

Decode an inference request into a high-level Python object.

decode_response()

Decode an inference response into a high-level Python object.

encode_request()

Encode the given payload into an inference request.

encode_response()

Encode the given payload into an inference response.

PandasCodec

Decodes a request (response) into a Pandas DataFrame, assuming each input (output) head corresponds to a column of the DataFrame.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_request()

Decode an inference request into a high-level Python object.

decode_response()

Decode an inference response into a high-level Python object.

encode_outputs()

encode_request()

Encode the given payload into an inference request.

encode_response()

Encode the given payload into an inference response.

RequestCodec

The RequestCodec interface lets you define request-level conversions between high-level Python types and the Open Inference Protocol. This can be useful where the encoding of your payload encompases multiple input heads (e.g. dataframes, where each column can be thought as a separate input head).

For individual input-level encoding / decoding, use the InputCodec interface instead.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_request()

Decode an inference request into a high-level Python object.

decode_response()

Decode an inference response into a high-level Python object.

encode_request()

Encode the given payload into an inference request.

encode_response()

Encode the given payload into an inference response.

StringCodec

Encodes a list of Python strings as a BYTES input (output).

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_input()

Decode a request input into a high-level Python type.

decode_output()

Decode a response output into a high-level Python type.

encode_input()

Encode the given payload into a RequestInput.

encode_output()

Encode the given payload into a response output.

StringRequestCodec

Decodes the first input (output) of request (response) as a list of strings. This codec can be useful for cases where the whole payload is a single list of strings.

Methods

can_encode()

Evaluate whether the codec can encode (decode) the payload.

decode_request()

Decode an inference request into a high-level Python object.

decode_response()

Decode an inference response into a high-level Python object.

encode_request()

Encode the given payload into an inference request.

encode_response()

Encode the given payload into an inference response.

decode_args()

No description available.

decode_inference_request()

No description available.

decode_request_input()

No description available.

encode_inference_response()

No description available.

encode_response_output()

No description available.

get_decoded()

No description available.

get_decoded_or_raw()

No description available.

has_decoded()

No description available.

register_input_codec()

No description available.

register_request_codec()

No description available.

Last updated

Was this helpful?