Fix: skip tag query if tag kbs are invalid (#10168)
### What problem does this PR solve? Skip `tag_query` step if `tag_kbs` are empty. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
7ccca2143c
commit
902703d145
1 changed files with 2 additions and 0 deletions
|
|
@ -138,6 +138,8 @@ def label_question(question, kbs):
|
|||
else:
|
||||
all_tags = json.loads(all_tags)
|
||||
tag_kbs = KnowledgebaseService.get_by_ids(tag_kb_ids)
|
||||
if not tag_kbs:
|
||||
return tags
|
||||
tags = settings.retrievaler.tag_query(question,
|
||||
list(set([kb.tenant_id for kb in tag_kbs])),
|
||||
tag_kb_ids,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue