langchain_community.embeddings.sagemaker_endpoint
.EmbeddingsContentHandler¶
- class langchain_community.embeddings.sagemaker_endpoint.EmbeddingsContentHandler[source]¶
LLM类的内容处理程序。
Attributes
accepts
从端点返回的响应数据的MIME类型
content_type
传递给端点的输入数据的MIME类型。
Methods
__init__
()transform_input
(prompt, model_kwargs)将输入转换为模型可以接受的格式,作为请求主体。应该以 content_type 请求头中指定的格式返回字节或可寻址文件对象。
transform_output
(output)将模型的输出转换为LLM类所期望的字符串。
- __init__()¶
- abstract transform_input(prompt: INPUT_TYPE, model_kwargs: Dict) bytes ¶
将输入转换为模型可以接受的格式,作为请求主体。应该以 content_type 请求头中指定的格式返回字节或可寻址文件对象。
- Parameters
prompt (INPUT_TYPE) –
model_kwargs (Dict) –
- Return type
bytes
- abstract transform_output(output: bytes) OUTPUT_TYPE ¶
将模型的输出转换为LLM类所期望的字符串。
- Parameters
output (bytes) –
- Return type
OUTPUT_TYPE