Skip to content

Commit

Permalink
Merge pull request fiatrete#84 from alexsunxl/main
Browse files Browse the repository at this point in the history
Fixed a crash with knowledge base arguments
  • Loading branch information
waterflier committed Oct 18, 2023
2 parents 31d4f91 + 71726d6 commit e4be896
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/service/aios_shell/aios_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,12 @@ async def handle_knowledge_commands(self, args):
else:
return show_text
if sub_cmd == "journal":
topn = 10 if len(args) == 1 else int(args[1])
journals = [str(journal) for journal in KnowledgePipline.get_instance().get_latest_journals(topn)]
print_formatted_text("\r\n".join(journals))
try:
topn = 10 if len(args) == 1 else int(args[1])
journals = [str(journal) for journal in KnowledgePipline.get_instance().get_latest_journals(topn)]
print_formatted_text("\r\n".join(journals))
except ValueError:
return FormattedText([("class:title", f"/knowledge journal failed: {args[1]} is not a valid integer.\n")])
if sub_cmd == "query":
if len(args) < 2:
return show_text
Expand Down

0 comments on commit e4be896

Please sign in to comment.