Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_embeddings_octoai-0.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_embeddings_octoai-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_octoai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6593384d35ae012beb3ed8158ff6e2f09bb442a6834de55391274f0cf107ad42
MD5 0ec25dc0f28c6b8c43d9c5f7a12efc82
BLAKE2b-256 fe6e7f7043a296d9ebcf0fa66e242796c02ccd0c5b7799bc5cfdc1a37ad55af2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_octoai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1868afd238e3655bf9493438dc1ca737b26d7dcdc08ddfe2e2ba4e0c39109d8a
MD5 91ea165c33eefe8616a4d39b7c272e27
BLAKE2b-256 d4f6be42ad01159d1925130568bfb5902f6c55014dae4dce703ca9a63a325bb8

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