mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-17 23:41:46 +00:00
Update to Vectara integration (#5950)
This PR updates the Vectara integration (@hwchase17 ): * Adds reuse of requests.session to imrpove efficiency and speed. * Utilizes Vectara's low-level API (instead of standard API) to better match user's specific chunking with LangChain * Now add_texts puts all the texts into a single Vectara document so indexing is much faster. * updated variables names from alpha to lambda_val (to be consistent with Vectara docs) and added n_context_sentence so it's available to use if needed. * Updates to documentation and tests --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e4224a396b
commit
f8cf09a230
@@ -27,7 +27,9 @@ def test_vectara_add_documents() -> None:
|
||||
)
|
||||
|
||||
# finally do a similarity search to see if all works okay
|
||||
output = docsearch.similarity_search("large language model", k=2)
|
||||
output = docsearch.similarity_search(
|
||||
"large language model", k=2, n_sentence_context=0
|
||||
)
|
||||
assert output[0].page_content == "large language model"
|
||||
assert output[0].metadata == {"abbr": "llm"}
|
||||
assert output[1].page_content == "information retrieval"
|
||||
|
Reference in New Issue
Block a user