LLMContentHandler#
- class langchain_community.llms.sagemaker_endpoint.LLMContentHandler[来源]#
LLM类的内容处理器。
属性
accepts从端点返回的响应数据的MIME类型
content_type传递给端点的输入数据的MIME类型
方法
transform_input(prompt, model_kwargs)将输入转换为模型可以接受的请求体格式。
transform_output(output)将模型的输出转换为LLM类期望的字符串。
- abstract transform_input(prompt: INPUT_TYPE, model_kwargs: Dict) bytes#
将输入转换为模型可以接受的格式作为请求体。应返回字节或可查找的文件类对象,格式应与content_type请求头中指定的格式一致。
- Parameters:
prompt (INPUT_TYPE)
model_kwargs (Dict)
- Return type:
字节
- abstract transform_output(output: bytes) OUTPUT_TYPE#
将模型的输出转换为LLM类期望的字符串。
- Parameters:
输出 (字节)
- Return type:
OUTPUT_TYPE
使用 LLMContentHandler 的示例