> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aurelio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# semantic_router.encoders.azure_openai

## AzureOpenAIEncoder Objects

```python theme={null}
class AzureOpenAIEncoder(DenseEncoder)
```

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\_\_

```python theme={null}
def __init__(
        name: Optional[str] = None,
        azure_endpoint: str | None = None,
        api_version: str | None = None,
        api_key: str | None = None,
        azure_ad_token: str | None = None,
        azure_ad_token_provider: Callable[[], str] | None = None,
        http_client_options: Optional[Dict[str, Any]] = None,
        deployment_name: str = EncoderDefault.AZURE.value["deployment_name"],
        score_threshold: float = 0.82,
        dimensions: Union[int, NotGiven] = NotGiven(),
        max_retries: int = 3)
```

Initialize the AzureOpenAIEncoder.

**Arguments**:

* `azure_endpoint` (`str, optional`): The endpoint for the Azure OpenAI API.
  Example: `"https://accountname.openai.azure.com"`
* `api_version` (`str, optional`): The version of the API to use.
  Example: `"2025-02-01-preview"`
* `api_key` (`str, optional`): The API key for the Azure OpenAI API.
* `azure_ad_token` (`str, optional`): The Azure AD/Entra ID token for authentication.
  [https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id](https://www.microsoft.com/en-us/security/business/identity-access/microsoft-entra-id)
* `str, optional`0 (`str, optional`1): A callable function that returns an Azure AD/Entra ID token.
* `str, optional`2 (`str, optional`3): Dictionary of options to configure httpx client
  Example:
  `str, optional`4
* `str, optional`5 (`str, optional`): The name of the model deployment to use.
* `str, optional`7 (`str, optional`8): The score threshold for filtering embeddings.
  Default is `str, optional`9.
* `"https://accountname.openai.azure.com"`0 (`"https://accountname.openai.azure.com"`1): The number of dimensions for the embeddings. If not given, it defaults to the model's default setting.
* `"https://accountname.openai.azure.com"`2 (`"https://accountname.openai.azure.com"`1): The maximum number of retries for API calls in case of failures.
  Default is `"https://accountname.openai.azure.com"`4.

#### \_\_call\_\_

```python theme={null}
def __call__(docs: List[str]) -> List[List[float]]
```

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

```python theme={null}
async def acall(docs: List[str]) -> List[List[float]]
```

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.
