BazaarLinkBazaarLink
Masuk
DokumentasiReferensi APIReferensi SDKPenggunaan AgentikSkill AI
Daftar isi

LlamaIndex

LlamaIndex

Gunakan BazaarLink dalam pipeline RAG LlamaIndex. LlamaIndex mendukung endpoint kompatibel OpenAI — cukup ubah dua parameter.

from llama_index.llms.openai import OpenAI
from llama_index.core import Settings

Settings.llm = OpenAI(
    model="openai/gpt-4o",
    api_base="https://api.bazaarlink.ai/v1",
    api_key="sk-bl-YOUR_API_KEY",
)

# Now use LlamaIndex normally — it calls BazaarLink
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader

documents = SimpleDirectoryReader("./docs").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("What is this documentation about?")
print(response)
Support
Hi! How can we help you?
Send a message and we'll get back to you soon.
LlamaIndex | BazaarLink