pyrit.embedding.AzureTextEmbedding#
- class AzureTextEmbedding(*, api_key: str | None = None, endpoint: str | None = None, deployment: str | None = None, api_version: str = '2024-02-01', use_entra_auth: bool = False)[source]#
Bases:
_TextEmbedding
- __init__(*, api_key: str | None = None, endpoint: str | None = None, deployment: str | None = None, api_version: str = '2024-02-01', use_entra_auth: bool = False) None [source]#
Generate embedding using the Azure API. Authenticate with either an API key or Entra authentication.
- Parameters:
api_key – The API key to use (only if you’re not using Entra authentication). Defaults to environment variable.
endpoint – The API base to use, sometimes referred to as the api_base. Defaults to environment variable.
deployment – The engine to use, in AOAI referred to as deployment, in some APIs referred to as model. Defaults to environment variable.
api_version – The API version to use. Defaults to “2024-02-01”.
use_entra_auth – Whether to use Entra authentication. Defaults to False.
Methods
__init__
(*[, api_key, endpoint, deployment, ...])Generate embedding using the Azure API.
generate_text_embedding
(text, **kwargs)Generate text embedding
Attributes