langchain.llms.sagemaker_endpoint.LLMContentHandler¶
- class langchain.llms.sagemaker_endpoint.LLMContentHandler[source]¶
Bases:
ContentHandlerBase[str,str]Content handler for LLM class.
Methods
__init__()transform_input(prompt, model_kwargs)Transforms the input to a format that model can accept as the request Body.
transform_output(output)Transforms the output from the model to string that the LLM class expects.
Attributes
The MIME type of the response data returned from endpoint
The MIME type of the input data passed to endpoint
- abstract transform_input(prompt: INPUT_TYPE, model_kwargs: Dict) bytes¶
Transforms the input to a format that model can accept as the request Body. Should return bytes or seekable file like object in the format specified in the content_type request header.
- abstract transform_output(output: bytes) OUTPUT_TYPE¶
Transforms the output from the model to string that the LLM class expects.
- accepts: Optional[str] = 'text/plain'¶
The MIME type of the response data returned from endpoint
- content_type: Optional[str] = 'text/plain'¶
The MIME type of the input data passed to endpoint