pyrit.embedding.AzureTextEmbedding#

class AzureTextEmbedding(*, api_key: str = None, endpoint: str = None, deployment: str = None, api_version: str = '2024-02-01')[source]#

Bases: _TextEmbedding

__init__(*, api_key: str = None, endpoint: str = None, deployment: str = None, api_version: str = '2024-02-01') None[source]#

Generate embedding using the Azure API

Parameters:
  • api_key – The API key to use. 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”.

Methods

__init__(*[, api_key, endpoint, deployment, ...])

Generate embedding using the Azure API

generate_text_embedding(text, **kwargs)

Generate text embedding

Attributes

API_KEY_ENVIRONMENT_VARIABLE: str = 'AZURE_OPENAI_EMBEDDING_KEY'#
DEPLOYMENT_ENVIRONMENT_VARIABLE: str = 'AZURE_OPENAI_EMBEDDING_DEPLOYMENT'#
ENDPOINT_URI_ENVIRONMENT_VARIABLE: str = 'AZURE_OPENAI_EMBEDDING_ENDPOINT'#