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
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
Close
Hashes for llama_index_embeddings_oracleai-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11988ab73f29698e974f9c4e33a67e25edf0362d1d222eb5e7e285d2f4d5f3c5 |
|
MD5 | cead5063f72887f309ada144e84aecbc |
|
BLAKE2b-256 | fbc68c7f78352c40251b9bbd1a859bb0029c65a6d91afb0d58127074175c3316 |
Close
Hashes for llama_index_embeddings_oracleai-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b03911dc321786b99c820509e7d4e52f795d2c19dc999a66e48f18d7074b3a7a |
|
MD5 | fe77dcf6fae99c74aa31cdd26ca89d59 |
|
BLAKE2b-256 | 1780bafebaa3c078d606d12285665a65defba63c8d8fff7492b7a596528b499e |