Skip to content

Commit c74b45e

Browse files
committed
simplification
1 parent 71e90dc commit c74b45e

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

dspy/retrieve/vectara_rm.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,20 +74,14 @@ def _vectara_query(
7474
query: query string
7575
"""
7676
# If multiple corpus ids are provided (comma-separated), create a list of corpus keys
77-
if ',' in self._vectara_corpus_id:
78-
corpus_key = [
79-
{
80-
"customerId": self._vectara_customer_id,
81-
"corpusId": corpus_id,
82-
"lexicalInterpolationConfig": {"lambda": 0.025 },
83-
} for corpus_id in self._vectara_corpus_id.split(',')
84-
]
85-
else:
86-
corpus_key = [{
77+
# otherwise by default, the `split(',')` is a no-op so retains the single corpus id
78+
corpus_key = [
79+
{
8780
"customerId": self._vectara_customer_id,
88-
"corpusId": self._vectara_corpus_id,
81+
"corpusId": corpus_id,
8982
"lexicalInterpolationConfig": {"lambda": 0.025 },
90-
}]
83+
} for corpus_id in self._vectara_corpus_id.split(',')
84+
]
9185

9286
data = {
9387
"query": [

0 commit comments

Comments
 (0)