Skip to main content

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


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

File metadata

File hashes

Hashes for llama_index_embeddings_cloudflare_workersai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e498e000fb13877a803db9dc50b896e973aac123cb816fc46b4239985f4ce3ed
MD5 4504c77972258cf491cb442935c6eae3
BLAKE2b-256 1dabf5712b3167f17dc312464f30d20e29cf037226a0194228e784e811e70197

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_cloudflare_workersai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe8de26a90ae3fb2abfe79c6c9aa076b81a8d4117f83ffdebf9c222afcca52fe
MD5 85274d165278622b19b15017d05b5a42
BLAKE2b-256 db625a16f6a77da02828321d7e0f34784249a7afdbb7e1f4ecbf5f5eb03e5d2e

See more details on using hashes here.

Supported by

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