fixed lint

This commit is contained in:
Ofer Mendelevitch 2023-08-28 22:31:39 -07:00
parent 8b8d2a6535
commit a5450be32e

View File

@ -260,7 +260,8 @@ class Vectara(VectorStore):
https://docs.vectara.com/docs/search-apis/sql/filter-overview https://docs.vectara.com/docs/search-apis/sql/filter-overview
for more details. for more details.
score_threshold: minimal score thresold for the result. score_threshold: minimal score thresold for the result.
If defined, results with score less than this value will be filtered out. If defined, results with score less than this value will be
filtered out.
n_sentence_context: number of sentences before/after the matching segment n_sentence_context: number of sentences before/after the matching segment
to add, defaults to 2 to add, defaults to 2
@ -309,7 +310,11 @@ class Vectara(VectorStore):
result = response.json() result = response.json()
if score_threshold: if score_threshold:
responses = [r for r in result["responseSet"][0]["response"] if r["score"] > score_threshold] responses = [
r
for r in result["responseSet"][0]["response"]
if r["score"] > score_threshold
]
else: else:
responses = result["responseSet"][0]["response"] responses = result["responseSet"][0]["response"]
documents = result["responseSet"][0]["document"] documents = result["responseSet"][0]["document"]