Spaces:
Sleeping
Sleeping
Update query.py
Browse files
query.py
CHANGED
@@ -9,7 +9,7 @@ def extract_between_tags(text, start_tag, end_tag):
|
|
9 |
return text[start_index+len(start_tag):end_index-len(end_tag)]
|
10 |
|
11 |
class VectaraQuery():
|
12 |
-
def __init__(self, api_key: str, customer_id:
|
13 |
self.customer_id = customer_id
|
14 |
self.corpus_ids = corpus_ids
|
15 |
self.api_key = api_key
|
@@ -17,7 +17,7 @@ class VectaraQuery():
|
|
17 |
|
18 |
def submit_query(self, query_str: str):
|
19 |
corpora_key_list = [{
|
20 |
-
'customer_id':
|
21 |
} for corpus_id in self.corpus_ids
|
22 |
]
|
23 |
|
@@ -27,7 +27,7 @@ class VectaraQuery():
|
|
27 |
headers = {
|
28 |
"Content-Type": "application/json",
|
29 |
"Accept": "application/json",
|
30 |
-
"customer-id":
|
31 |
"x-api-key": self.api_key,
|
32 |
"grpc-timeout": "60S"
|
33 |
}
|
|
|
9 |
return text[start_index+len(start_tag):end_index-len(end_tag)]
|
10 |
|
11 |
class VectaraQuery():
|
12 |
+
def __init__(self, api_key: str, customer_id: str, corpus_ids: list[str]):
|
13 |
self.customer_id = customer_id
|
14 |
self.corpus_ids = corpus_ids
|
15 |
self.api_key = api_key
|
|
|
17 |
|
18 |
def submit_query(self, query_str: str):
|
19 |
corpora_key_list = [{
|
20 |
+
'customer_id': self.customer_id, 'corpus_id': corpus_id, 'lexical_interpolation_config': {'lambda': 0.025}
|
21 |
} for corpus_id in self.corpus_ids
|
22 |
]
|
23 |
|
|
|
27 |
headers = {
|
28 |
"Content-Type": "application/json",
|
29 |
"Accept": "application/json",
|
30 |
+
"customer-id": self.customer_id,
|
31 |
"x-api-key": self.api_key,
|
32 |
"grpc-timeout": "60S"
|
33 |
}
|