Deduplicate _embed() logic (fixes #760) #807

Open
sleepy wants to merge 0 commits from fix/760-deduplicate-embed into main
Owner

Both VectorRAG._embed() and MemoryVectorStore._embed() had near-identical embedding logic. Created shared embed_texts() helper in src/embeddings.py and updated both consumers. Closes #760

Both VectorRAG._embed() and MemoryVectorStore._embed() had near-identical embedding logic. Created shared embed_texts() helper in src/embeddings.py and updated both consumers. Closes #760
Both VectorRAG._embed() and MemoryVectorStore._embed() had near-identical
embedding logic. The only difference was rag_vector.py wrapping through
numpy before tolist(), which is redundant since encode() already returns
an np.float32 array.

Create shared embed_texts() helper in src/embeddings.py and update both
consumers to use it. Removes unused numpy import from rag_vector.py.
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/760-deduplicate-embed:fix/760-deduplicate-embed
git switch fix/760-deduplicate-embed

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/760-deduplicate-embed
git switch fix/760-deduplicate-embed
git rebase main
git switch main
git merge --ff-only fix/760-deduplicate-embed
git switch fix/760-deduplicate-embed
git rebase main
git switch main
git merge --no-ff fix/760-deduplicate-embed
git switch main
git merge --squash fix/760-deduplicate-embed
git switch main
git merge --ff-only fix/760-deduplicate-embed
git switch main
git merge fix/760-deduplicate-embed
git push origin main
Sign in to join this conversation.
No description provided.