llama-index embeddings octoai integration
Project description
LlamaIndex Embeddings Integration: Octoai
Using the OctoAI Embeddings Integration is a simple as:
from llama_index.embeddings.octoai import OctoAIEmbedding
from os import environ
OCTOAI_API_KEY = environ["OCTOAI_API_KEY"]
embed_model = OctoAIEmbedding(api_key=OCTOAI_API_KEY)
embeddings = embed_model.get_text_embedding("How do I sail to the moon?")
assert len(embeddings) == 1024
One can also request a batch of embeddings via:
texts = [
"How do I sail to the moon?",
"What is the best way to cook a steak?",
"How do I apply for a job?",
]
embeddings = embed_model.get_text_embedding_batch(texts)
assert len(embeddings) == 3
API Access
Here are some instructions on how to get your OctoAI API key.
Contributing
Follow the good practices of all poetry based projects.
When in VScode, one may want to manually select the Python interpreter, specially to run the example iPython notebook. For this use ctrl+shift+p
, then type or select: Python: Select Interpreter
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_octoai-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_embeddings_octoai-0.3.0.tar.gz
- Upload date:
- Size: 3.2 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 | 5377939729be00aaf7d5456f918393b05a0b6daeb3919b25cf06c5ae1baace49 |
|
MD5 | 0be6489230ed7f3bc63022cca1a0bdce |
|
BLAKE2b-256 | c7f197f984603b03ed0715e62948c03188c30e4aa9e1b75272e76a239319fd74 |
File details
Details for the file llama_index_embeddings_octoai-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_embeddings_octoai-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.8 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 | b25b9cd894d295a1b30b0071389507ab71109605afb0db96aa08d6bd7ba62b50 |
|
MD5 | 8e9d5e66b3790dd4bcc3de012b5be5d2 |
|
BLAKE2b-256 | 9a88f6c926ea65320189824d2b7524429925c46bd32dd2eb52953acc1a7743dd |