Fix W|A bug and improve error message
This commit is contained in:
parent
9283a34bea
commit
dbc6bc0f43
5
main.py
5
main.py
|
@ -147,7 +147,7 @@ def think_send(query):
|
||||||
|
|
||||||
if len(result) > 500:
|
if len(result) > 500:
|
||||||
result = result[:500] + '... truncated.'
|
result = result[:500] + '... truncated.'
|
||||||
elif len(result) == 0 and not img_url:
|
elif len(result) == 0:
|
||||||
result = 'Error'
|
result = 'Error'
|
||||||
|
|
||||||
result = result.replace('Wolfram|Alpha', 'Protovac')
|
result = result.replace('Wolfram|Alpha', 'Protovac')
|
||||||
|
@ -163,6 +163,9 @@ def think_send(query):
|
||||||
if '(although' in result:
|
if '(although' in result:
|
||||||
result = result.split('(although')[0]
|
result = result.split('(although')[0]
|
||||||
|
|
||||||
|
if result == 'Error':
|
||||||
|
result = 'INSUFFICIENT DATA FOR A MEANINGFUL ANSWER.'
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
skip_input = False
|
skip_input = False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user