langchain_community.llms.azureml_endpoint.LlamaContentFormatter

class langchain_community.llms.azureml_endpoint.LlamaContentFormatter[source]

已弃用:保留以确保向后兼容

Llama的内容格式化程序。

Attributes

accepts

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

content_formatter

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, ...)

根据所选的API格式化请求

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) bytes

根据所选的API格式化请求

Parameters
Return type

bytes

format_response_payload(output: bytes, api_type: AzureMLEndpointApiType) Generation

格式化响应

Parameters
Return type

Generation