AzureAIEmbeddingsModel#
- class langchain_azure_ai.embeddings.inference.AzureAIEmbeddingsModel[source]#
Bases:
ModelInferenceService
,Embeddings
Azure AI model inference for embeddings.
Examples
If your endpoint supports multiple models, indicate the parameter model_name:
- Troubleshooting:
To diagnostic issues with the model, you can enable debug logging:
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- param api_version: str | None = None#
The API version to use with Azure. If None, the default version is used.
- param client_kwargs: Dict[str, Any] = {}#
Additional keyword arguments to pass to the client.
- param credential: str | AzureKeyCredential | TokenCredential | None = None#
The API key or credential to use to connect to the service. If using a project endpoint, this must be of type TokenCredential since only Microsoft EntraID is supported.
- param dimensions: int | None = None#
The number of dimensions in the embeddings to generate. If None, the modelβs default is used.
- param embed_batch_size: int = 1024#
The batch size for embedding requests. The default is 1024.
- param endpoint: str | None = None#
The endpoint of the specific service to connect to. If you are connecting to a model, use the URL of the model deployment.
- param model_kwargs: Dict[str, Any] = {}#
Additional kwargs model parameters.
- param model_name: str | None = None (alias 'model')#
The name of the model to use for inference, if the endpoint is running more than one model. If not, this parameter is ignored.
- param project_endpoint: str | None = None#
The project endpoint associated with the AI project. If this is specified, then the endpoint parameter becomes optional and credential has to be of type TokenCredential.
- param service: Literal['inference'] = 'inference'#
The type of service to connect to. For Inference Services, use βinferenceβ.
- classmethod validate_environment(
- values: Dict,
Validate that required values are present in the environment.
- Parameters:
values (Dict)
- Return type:
Any
- async aembed_documents(
- texts: list[str],
Asynchronous Embed search docs.
- Parameters:
texts (list[str]) β List of text to embed.
- Returns:
List of embeddings.
- Return type:
list[list[float]]
- async aembed_query(
- text: str,
Asynchronous Embed query text.
- Parameters:
text (str) β Text to embed.
- Returns:
Embedding.
- Return type:
list[float]