langchain-ai / rag-from-scratch

1.63k stars 453 forks source link

[Part2: Indexing] embed_query() or embed_documents()? #9

Open ylXuu opened 4 months ago

ylXuu commented 4 months ago

Hi @rlancemartin , thanks for your clear tutorial. I got a simple question about Part 2: Indexing.

query_result = embd.embed_query(question)
document_result = embd.embed_query(document)

Why not use "embed_documents([document])" here? Forgive me for not being very clear about these functions.