langchain_community.chat_models.azureml_endpoint.LlamaContentFormatter

class langchain_community.chat_models.azureml_endpoint.LlamaContentFormatter[source]

`LLaMA`的内容格式化程序。

Attributes

accepts

从端点返回的响应数据的MIME类型

content_type

输入数据传递到端点的MIME类型

format_error_msg

supported_api_types

给定格式化程序支持的API。Azure ML支持使用不同的托管方法部署模型。每种方法可能具有不同的API结构。

Methods

__init__()

escape_special_characters(prompt)

转义`prompt`中的任何特殊字符

format_request_payload(prompt, model_kwargs)

根据模型的输入模式格式化请求体。根据请求头中指定的content_type返回字节或可寻址文件对象。

format_response_payload(output[, api_type])

根据模型的输出模式格式化响应主体。返回从响应接收到的数据类型。

Return type

None

__init__() None[source]
Return type

None

static escape_special_characters(prompt: str) str

转义`prompt`中的任何特殊字符

Parameters

prompt (str) –

Return type

str

format_request_payload(prompt: str, model_kwargs: Dict, api_type: AzureMLEndpointApiType = AzureMLEndpointApiType.dedicated) Any

根据模型的输入模式格式化请求体。根据请求头中指定的content_type返回字节或可寻址文件对象。

Parameters
Return type

Any

abstract format_response_payload(output: bytes, api_type: AzureMLEndpointApiType = AzureMLEndpointApiType.dedicated) Generation

根据模型的输出模式格式化响应主体。返回从响应接收到的数据类型。

Parameters
Return type

Generation