Embeddings (Coming soon)
Vector embeddings convert text into numerical representations that capture semantic meaning, enabling semantic search, clustering, and recommendation systems.
Preview: Creating Embeddings
Section titled “Preview: Creating Embeddings”# This is a preview of the upcoming Embeddings APIfrom openai import OpenAI
# Set your API key and base URLclient = 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 textresponse = 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.