Skip to main content

llama-index embeddings AutoEmbeddings integration

Project description

LlamaIndex Embeddings Integration: AutoEmbeddings

AutoEmbeddings is a very useful module available within Chonkie that can initialize several different embeddings providers within one single interface:

  • OpenAI
  • Model2Vec
  • Cohere
  • Jina AI
  • Sentence Transformers

You can install it with:

pip install llama-index-embeddings-autoembeddings

And then you can use it in your scripts as:

from llama_index.embeddings.autoembeddings import ChonkieAutoEmbedding

embedder = ChonkieAutoEmbedding(model_name="all-MiniLM-L6-v2")
vector = embedder.get_text_embedding(
    "The quick brown fox jumps over the lazy dog."
)
print(vector)

If you want to use it with a non-local embeddings provider, you should declare the API key as an environment variable:

from llama_index.embeddings.autoembeddings import ChonkieAutoEmbedding
import os

os.environ["OPENAI_API_KEY"] = "YOUR-API-KEY"
embedder = ChonkieAutoEmbedding(model_name="text-embedding-3-large")
vector = embedder.get_text_embedding(
    "The quick brown fox jumps over the lazy dog."
)
print(vector)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file llama_index_embeddings_autoembeddings-0.2.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_autoembeddings-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b97253ba53a742dd805ecb729693b239d76b5c70b43c79b457b3b385bb3e1473
MD5 a6d6989be93577cc57c695ab315e3cfb
BLAKE2b-256 89e50c857de429f4c75ace487bcf9719a5ffcf7562c4e828d6a88f5e1701721b

See more details on using hashes here.

File details

Details for the file llama_index_embeddings_autoembeddings-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_embeddings_autoembeddings-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 124357bedacd29fcbd7179da87362e3e31170d2ef1f583824a88964bb8ca3bd4
MD5 696ab85a94dfbf803f6273e446722597
BLAKE2b-256 3dac2a6c0a767ca061f147c51eaaa052e0be65fd51124e9ebec16f67ed3da087

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page