LlamaContentFormatter#
- class langchain_community.llms.azureml_endpoint.LlamaContentFormatter[source]#
Deprecated: Kept for backwards compatibility
Content formatter for Llama.
Attributes
accepts
The MIME type of the response data returned from the endpoint
content_formatter
content_type
The MIME type of the input data passed to the endpoint
format_error_msg
supported_api_types
Supported APIs for the given formatter.
Methods
__init__
()escape_special_characters
(prompt)Escapes any special characters in prompt
format_request_payload
(prompt,Β model_kwargs,Β ...)Formats the request according to the chosen api
format_response_payload
(output,Β api_type)Formats response
- static escape_special_characters(prompt: str) str #
Escapes any special characters in prompt
- Parameters:
prompt (str) β
- Return type:
str
- format_request_payload(prompt: str, model_kwargs: Dict, api_type: AzureMLEndpointApiType) bytes #
Formats the request according to the chosen api
- Parameters:
prompt (str) β
model_kwargs (Dict) β
api_type (AzureMLEndpointApiType) β
- Return type:
bytes
- format_response_payload(output: bytes, api_type: AzureMLEndpointApiType) Generation #
Formats response
- Parameters:
output (bytes) β
api_type (AzureMLEndpointApiType) β
- Return type: