حساب ناقلات الوثيقة والاستعلام مع openai/text-embedding-3-large
استرداد Top-K من متجر المتجهات (FAISS / Milvus / pgvector)
إعادة الترتيب مع cohere/rerank-english-v3
قم بخياطة قطع Top-N في الموجه واتركها cohere/command-r-plus أو Claude قم بإنشاء الإجابة النهائية
التضمين
python
resp = client.embeddings.create(
model="openai/text-embedding-3-large",
input=[chunk.text for chunk in chunks],
)
vectors = [d.embedding for d in resp.data]
قالب سريع
text
You are an expert assistant. Answer based ONLY on context.
If the answer is not in the context, say "I don't know".
[Context]
{retrieved_chunks}
[Question]
{user_question}