Spaces:
Sleeping
Sleeping
iamrobotbear
commited on
Update query.py
Browse files
query.py
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
import requests
|
2 |
import json
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
class VectaraQuery():
|
5 |
def __init__(self, api_key: str, customer_id: str, corpus_id: str, prompt_name: str = None):
|
|
|
1 |
import requests
|
2 |
import json
|
3 |
+
import re
|
4 |
+
|
5 |
+
def extract_between_tags(text, start_tag, end_tag):
|
6 |
+
start_index = text.find(start_tag)
|
7 |
+
end_index = text.find(end_tag, start_index)
|
8 |
+
return text[start_index+len(start_tag):end_index-len(end_tag)]
|
9 |
|
10 |
class VectaraQuery():
|
11 |
def __init__(self, api_key: str, customer_id: str, corpus_id: str, prompt_name: str = None):
|