Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Use SynapsAI Cloud embeddings and chat models with LlamaIndex
export OPENAI_API_KEY="$SYNAPSAI_API_KEY" export OPENAI_API_BASE="https://api.synapsai.cloud/v1"
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings from llama_index.llms.openai import OpenAI from llama_index.embeddings.openai import OpenAIEmbedding Settings.llm = OpenAI(model="<YOUR_MODEL_ID>", temperature=0.2) Settings.embed_model = OpenAIEmbedding(model="<YOUR_EMBEDDING_MODEL_ID>") documents = SimpleDirectoryReader("example_docs/").load_data() index = VectorStoreIndex.from_documents(documents) query_engine = index.as_query_engine() response = query_engine.query("What are the core steps to deploy a model?") print(response)
pip install llama-index llama-index-llms-openai llama-index-embeddings-openai
vector_stores