BazaarLinkBazaarLink
เข้าสู่ระบบ
เอกสารAPI ข้อมูลอ้างอิงSDK ข้อมูลอ้างอิงการใช้งาน AgentAI ทักษะ
สารบัญ

LlamaIndex

LlamaIndex

ใช้ BazaarLink ในไปป์ไลน์ LlamaIndex RAG LlamaIndex รองรับตำแหน่งข้อมูลที่รองรับ OpenAI เพียงแค่เปลี่ยนพารามิเตอร์สองตัว

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.