|
|
|
|
@ -25,6 +25,16 @@ class AzureOpenAITextEmbeddingModel(_CommonAzureOpenAI, TextEmbeddingModel):
|
|
|
|
|
user: Optional[str] = None,
|
|
|
|
|
input_type: EmbeddingInputType = EmbeddingInputType.DOCUMENT,
|
|
|
|
|
) -> TextEmbeddingResult:
|
|
|
|
|
"""
|
|
|
|
|
Invoke text embedding model
|
|
|
|
|
|
|
|
|
|
:param model: model name
|
|
|
|
|
:param credentials: model credentials
|
|
|
|
|
:param texts: texts to embed
|
|
|
|
|
:param user: unique user id
|
|
|
|
|
:param input_type: input type
|
|
|
|
|
:return: embeddings result
|
|
|
|
|
"""
|
|
|
|
|
base_model_name = credentials["base_model_name"]
|
|
|
|
|
credentials_kwargs = self._to_credential_kwargs(credentials)
|
|
|
|
|
client = AzureOpenAI(**credentials_kwargs)
|
|
|
|
|
|