Back to Llama Index

GigaChat

docs/examples/embeddings/gigachat.ipynb

0.14.21619 B
Original Source

GigaChat

python
%pip install llama-index-embeddings-gigachat
python
!pip install llama-index
python
from llama_index.embeddings.gigachat import GigaChatEmbedding

gigachat_embedding = GigaChatEmbedding(
    auth_data="your-auth-data",
    scope="your-scope",  # Set scope 'GIGACHAT_API_PERS' for personal use or 'GIGACHAT_API_CORP' for corporate use.
)

queries_embedding = gigachat_embedding._get_query_embeddings(
    ["This is a passage!", "This is another passage"]
)
print(queries_embedding)

text_embedding = gigachat_embedding._get_text_embedding("Where is blue?")
print(text_embedding)