DigitalOcean AI embeddings integration for LlamaIndex.
Project description
DigitalOcean Embeddings for LlamaIndex
This package provides a DigitalOceanEmbeddings implementation for LlamaIndex that calls DigitalOcean AI embeddings endpoints.
Quickstart
-
Install:
pip install llama-index-digitalocean-embeddings -
Set environment variable:
-
DIGITALOCEAN_TOKEN: DigitalOcean Personal Access Token with AI access. -
Getting a DigitalOcean token
Your
DIGITALOCEAN_TOKENis a Personal Access Token you create in the DigitalOcean Control Panel:a. Log in to
https://cloud.digitalocean.com. b. Go to Settings → API → Personal Access Tokens. c. Click Generate New Token, choose the scopes you need (for embeddings, typically CRUD for GenAI and read for project), give the token a name, and click Generate. d. Copy the token and set it in your shell:export DIGITALOCEAN_TOKEN=your_token_here
For more detailed, step‑by‑step guidance, see the official DigitalOcean documentation.
-
-
Use:
import os from llama_index.digitalocean.embeddings import DigitalOceanEmbeddings from llama_index.core import VectorStoreIndex, Document # Read your token however you like (for example from an env var) and # pass it explicitly to the embedding class: token = os.environ["DIGITALOCEAN_TOKEN"] embed_model = DigitalOceanEmbeddings(model="text-embedding-3-small", api_token=token) docs = [Document(text="Hello from DigitalOcean")] index = VectorStoreIndex.from_documents(docs, embed_model=embed_model) print(index.as_query_engine().query("What was the greeting?"))
Configuration
model: Embedding model name (e.g.,text-embedding-3-small,text-embedding-3-large).api_token:DIGITALOCEAN_TOKEN.
License
Apache-2.0.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_digitalocean_embeddings-0.1.7.tar.gz.
File metadata
- Download URL: llama_index_digitalocean_embeddings-0.1.7.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89a1c08d270b143f9381a1fcd1ddca84435046c3e396274447bc3e835069ae04
|
|
| MD5 |
fee65e2c223334a789b641ff6eba3980
|
|
| BLAKE2b-256 |
a24e3eb4a4e3a6efe565be4bf47a89d164db7541225509157e07b985a5d29f80
|
File details
Details for the file llama_index_digitalocean_embeddings-0.1.7-py3-none-any.whl.
File metadata
- Download URL: llama_index_digitalocean_embeddings-0.1.7-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
957cac74d4863881dba89a7207d38f6c47222e333ad89d1ad2891d1ea887c64d
|
|
| MD5 |
9bb29f34449d837709b56efda02d9555
|
|
| BLAKE2b-256 |
8ef73d9632fee165797284a1285dbea3fab69c6f631e1fbe3e76c1525cfb960b
|