encoders
semantic_router.encoders.zure
AzureOpenAIEncoder Objects
Encoder for Azure OpenAI API.
This class provides functionality to encode text documents using the Azure OpenAI API. It supports customization of the score threshold for filtering or processing the embeddings.
__init__
Initialize the AzureOpenAIEncoder.
Arguments:
api_key
(str
): The API key for the Azure OpenAI API.deployment_name
(str
): The name of the deployment to use.azure_endpoint
(str
): The endpoint for the Azure OpenAI API.api_version
(str
): The version of the API to use.model
(str
): The model to use.str
0 (str
1): The score threshold for the embeddings.str
2 (str
3): The dimensions of the embeddings.str
4 (str
3): The maximum number of retries for the API call.
__call__
Encode a list of documents into embeddings using the Azure OpenAI API.
Arguments:
docs
(List[str]
): The documents to encode.
Returns:
List[List[float]]
: The embeddings for the documents.
acall
Encode a list of documents into embeddings using the Azure OpenAI API asynchronously.
Arguments:
docs
(List[str]
): The documents to encode.
Returns:
List[List[float]]
: The embeddings for the documents.