DAN-55 Intent Model (#89)

Includes:
- Intent Model
- Heuristic Classifications
- GPT self error classification
- Bugfix on finding end of answer stream
This commit is contained in:
Yuhong Sun
2023-06-07 15:27:06 -07:00
committed by GitHub
parent 0f1f16880a
commit 7c97cc4626
16 changed files with 245 additions and 68 deletions

View File

@@ -96,19 +96,15 @@ if __name__ == "__main__":
"query": query,
"collection": QDRANT_DEFAULT_COLLECTION,
"use_keyword": flow_type == "keyword", # Ignore if not QA Endpoints
"filters": json.dumps([{SOURCE_TYPE: source_types}]),
"filters": [{SOURCE_TYPE: source_types}],
}
if args.stream:
with requests.get(
endpoint, params=urllib.parse.urlencode(query_json), stream=True
) as r:
with requests.post(endpoint, json=query_json, stream=True) as r:
for json_response in r.iter_lines():
pprint(json.loads(json_response.decode()))
else:
response = requests.get(
endpoint, params=urllib.parse.urlencode(query_json)
)
response = requests.post(endpoint, json=query_json)
contents = json.loads(response.content)
pprint(contents)