Skip to main content

llama-index embeddings oracleai integration

Project description

LlamaIndex Embeddings Integration: Oracleai

This API is to generate an embedding from a text.

pip install llama-index-embeddings-oracleai

A sample example

from typing import TYPE_CHECKING
from llama_index.core.embeddings import BaseEmbedding
from llama_index.embeddings.oracleai import OracleEmbeddings

if TYPE_CHECKING:
    import oracledb

""" get the Oracle connection """
conn = oracledb.connect(
    user="<user>",
    password="<password>",
    dsn="<dsn>",
)
print("Oracle connection is established...")

""" params """
embedder_params = {"provider": "<provider_name>", "model": "<model_name>"}
proxy = "<proxy>"

""" instance """
embedder = OracleEmbeddings(conn=conn, params=embedder_params, proxy=proxy)

embed = embedder._get_text_embedding("Hello World, Text!")
print(f"Embedding generated by OracleEmbeddings: {embed}")

embed = embedder._get_query_embedding("Hello World, Query!")
print(f"Embedding generated by OracleEmbeddings: {embed}")

conn.close()
print("Connection is closed.")

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_oracleai-0.1.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

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