debug backend API for TAB 'search' (#2389)
### What problem does this PR solve? #2247 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -261,7 +261,7 @@ def retrieval_test():
|
||||
kb_id = req["kb_id"]
|
||||
if isinstance(kb_id, str): kb_id = [kb_id]
|
||||
doc_ids = req.get("doc_ids", [])
|
||||
similarity_threshold = float(req.get("similarity_threshold", 0.2))
|
||||
similarity_threshold = float(req.get("similarity_threshold", 0.0))
|
||||
vector_similarity_weight = float(req.get("vector_similarity_weight", 0.3))
|
||||
top = int(req.get("top_k", 1024))
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#
|
||||
import json
|
||||
import re
|
||||
import traceback
|
||||
from copy import deepcopy
|
||||
|
||||
from api.db.services.user_service import UserTenantService
|
||||
from flask import request, Response
|
||||
from flask_login import login_required, current_user
|
||||
@@ -333,6 +333,8 @@ def mindmap():
|
||||
0.3, 0.3, aggs=False)
|
||||
mindmap = MindMapExtractor(chat_mdl)
|
||||
mind_map = mindmap([c["content_with_weight"] for c in ranks["chunks"]]).output
|
||||
if "error" in mind_map:
|
||||
return server_error_response(Exception(mind_map["error"]))
|
||||
return get_json_result(data=mind_map)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user