langchain.embeddings.ernie.ErnieEmbeddings¶
class langchain.embeddings.ernie.ErnieEmbeddings[source]¶
Bases: BaseModel, Embeddings
Ernie Embeddings V1 embedding models.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param access_token: Optional[str] = None¶
param chunk_size: int = 16¶
param ernie_api_base: Optional[str] = None¶
param ernie_client_id: Optional[str] = None¶
param ernie_client_secret: Optional[str] = None¶
async aembed_documents(texts: List[str]) → List[List[float]][source]¶
Asynchronous Embed search docs.
Parameters
texts – The list of texts to embed
Returns
List of embeddings, one for each text.
Return type
List[List[float]]
async aembed_query(text: str) → List[float][source]¶
Asynchronous Embed query text.
Parameters
text – The text to embed.
Returns
Embeddings for the text.
Return type
List[float]
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally choose which fields to include, exclude and change.