llama-index embeddings Cloudflare Workers AI integration
Project description
LlamaIndex Embeddings Integration: Cloudflare Workers AI
Cloudflare Workers AI provides text embedding service for Cloudflare users. You can find a full list of available models from its document https://developers.cloudflare.com/workers-ai/models/#text-embeddings
To learn more about Cloudflare Workers AI in general, visit https://developers.cloudflare.com/workers-ai/
Example
pip install llama-index-embeddings-cloudflare-workersai
from llama_index.embeddings.cloudflare_workersai import CloudflareEmbedding
my_account_id = "example_account_id"
my_api_token = "example_token"
my_embed = CloudflareEmbedding(
account_id=my_account_id,
auth_token=my_api_token,
model="@cf/baai/bge-base-en-v1.5",
)
embeddings = my_embed.get_text_embedding("Why sky is blue")
embeddings_batch = my_embed.get_text_embedding_batch(
["Why sky is blue", "Why roses are red"]
)
For more detailed example of installation and usage, please refer to the Jupyter Notebook example.
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file llama_index_embeddings_cloudflare_workersai-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_embeddings_cloudflare_workersai-0.3.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6295d6fa04953ff8ab806e73aaa2f1ccafe17024dbe0a558715e2804bdd2cd91 |
|
MD5 | 6aeb15e8a1eb0d456361ff44942ba591 |
|
BLAKE2b-256 | 9e9a57552e88f9b9719c9b79b8339074b3293e4f93da601b1c079abd94c4046a |
File details
Details for the file llama_index_embeddings_cloudflare_workersai-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_embeddings_cloudflare_workersai-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6c3943424b9b7d7e4ab4239cd79b0880c274f222d7c00dd27b787a235931ae8 |
|
MD5 | 4a9f3b6e92617593dd19886d79e11227 |
|
BLAKE2b-256 | bffaf6dffc51eda9b336c22edfd702188a621064ab0377fae9cc87a0b53a2b47 |