GigaChatEmbeddings#

class langchain_community.embeddings.gigachat.GigaChatEmbeddings[source]#

Bases: BaseModel, Embeddings

GigaChat Embeddings models.

Example

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 access_token: str | None = None#

Access token for GigaChat

param auth_url: str | None = None#

Auth URL

param base_url: str | None = None#

Base API URL

param ca_bundle_file: str | None = None#
param cert_file: str | None = None#
param credentials: str | None = None#

Auth Token

param key_file: str | None = None#
param key_file_password: str | None = None#
param model: str | None = None#

Model name to use.

param password: str | None = None#

Password for authenticate

param scope: str | None = None#

Permission scope for access token

param timeout: float | None = 600#

Timeout for request. By default it works for long requests.

param user: str | None = None#

Username for authenticate

param verify_ssl_certs: bool | None = None#

Check certificates for all requests

async aembed_documents(texts: List[str]) List[List[float]][source]#

Embed documents using a GigaChat embeddings models.

Parameters:

texts (List[str]) – 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]#

Embed a query using a GigaChat embeddings models.

Parameters:

text (str) – The text to embed.

Returns:

Embeddings for the text.

Return type:

List[float]

embed_documents(texts: List[str]) List[List[float]][source]#

Embed documents using a GigaChat embeddings models.

Parameters:

texts (List[str]) – The list of texts to embed.

Returns:

List of embeddings, one for each text.

Return type:

List[List[float]]

embed_query(text: str) List[float][source]#

Embed a query using a GigaChat embeddings models.

Parameters:

text (str) – The text to embed.

Returns:

Embeddings for the text.

Return type:

List[float]

classmethod validate_environment(values: Dict) Dict[source]#

Validate authenticate data in environment and python package is installed.

Parameters:

values (Dict)

Return type:

Dict

Examples using GigaChatEmbeddings