mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
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:
@@ -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):
|
||||||
|
Reference in New Issue
Block a user