CustomOpenAIContentFormatter#
- class langchain_community.llms.azureml_endpoint.CustomOpenAIContentFormatter[source]#
Content formatter for models that use the OpenAI like API scheme.
Attributes
acceptsThe MIME type of the response data returned from the endpoint
content_typeThe MIME type of the input data passed to the endpoint
format_error_msgsupported_api_typesSupported APIs for the given formatter.
Methods
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,
Escapes any special characters in prompt
- Parameters:
prompt (str)
- Return type:
str
- format_request_payload(
- prompt: str,
- model_kwargs: Dict,
- api_type: AzureMLEndpointApiType,
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,
Formats response
- Parameters:
output (bytes)
api_type (AzureMLEndpointApiType)
- Return type:
Examples using CustomOpenAIContentFormatter