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.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_autoembeddings-0.2.0.tar.gz
Algorithm Hash digest
SHA256 460e5564b202dabac9b3479003f241bb907196792dbf5817f8d2a1ece04922c5
MD5 8260a254d00d7c3f8670eed6180c5cb3
BLAKE2b-256 e122ff93b6e230e5bed01d0af30ac4902b56ba571934fb3ad6ac05422028ab45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_autoembeddings-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 621a8d565ca0d6923dbe21905f32c52821e7f705232907e8372ee6e14445cc9a
MD5 cfab047e87412b6c8aac5260bd0e8cbe
BLAKE2b-256 3beaf81b30de5392d17ec655db196900b1af20a24b2dbeee2702dfe3711d2488

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