Skip to content

Embeddings (Coming soon)

Vector embeddings convert text into numerical representations that capture semantic meaning, enabling semantic search, clustering, and recommendation systems.

# This is a preview of the upcoming Embeddings API
from openai import OpenAI
# Set your API key and base URL
client = OpenAI(
base_url = "https://api.oraicle.me/v1",
# For production, you should not place your key
# in the code but in the environment variables
api_key = "<your_api_key>",
)
# Create embeddings for text
response = client.embeddings.create(
model="<embedding_model>", # More models will be available at launch
input="Your text to embed"
)
embedding = response['data'][0]['embedding']
# Use the embedding vector for semantic search, clustering, etc.