MultiServer: Improve command response to help troubleshooting (#2833)

* Update MultiServer.py

* Improve logging again

* Add to other log as well

* Update MultiServer.py
This commit is contained in:
chandler05 2024-03-11 03:55:22 -05:00 committed by GitHub
parent fed3d04c8d
commit 9c920fbc53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -1052,17 +1052,19 @@ def get_intended_text(input_text: str, possible_answers) -> typing.Tuple[str, bo
if picks[0][1] == 100: if picks[0][1] == 100:
return picks[0][0], True, "Perfect Match" return picks[0][0], True, "Perfect Match"
elif picks[0][1] < 75: elif picks[0][1] < 75:
return picks[0][0], False, f"Didn't find something that closely matches, " \ return picks[0][0], False, f"Didn't find something that closely matches '{input_text}', " \
f"did you mean {picks[0][0]}? ({picks[0][1]}% sure)" f"did you mean '{picks[0][0]}'? ({picks[0][1]}% sure)"
elif dif > 5: elif dif > 5:
return picks[0][0], True, "Close Match" return picks[0][0], True, "Close Match"
else: else:
return picks[0][0], False, f"Too many close matches, did you mean {picks[0][0]}? ({picks[0][1]}% sure)" return picks[0][0], False, f"Too many close matches for '{input_text}', " \
f"did you mean '{picks[0][0]}'? ({picks[0][1]}% sure)"
else: else:
if picks[0][1] > 90: if picks[0][1] > 90:
return picks[0][0], True, "Only Option Match" return picks[0][0], True, "Only Option Match"
else: else:
return picks[0][0], False, f"Did you mean {picks[0][0]}? ({picks[0][1]}% sure)" return picks[0][0], False, f"Didn't find something that closely matches '{input_text}', " \
f"did you mean '{picks[0][0]}'? ({picks[0][1]}% sure)"
class CommandMeta(type): class CommandMeta(type):