Closed tugapower0 closed 8 years ago
You have to use a trial API key (here
) and make requests to simsimi. If you have any troubles ask again.
can you show what part of code must change ?
You could for example add this library to your lib
folder. Then add this code to your else
statement:
else:
from lib.simsimi import SimSimi
from lib.language_codes import LC_ITALIANO
from lib.simsimi import SimSimiException
back = ''
simSimi = SimSimi(conversation_language=LC_ITALIANO,
conversation_key='YOUR_API_KEY')
try:
from unicodedata import normalize
text = normalize('NFKD', text).encode('ASCII', 'ignore')
response = simSimi.getConversation(text)
if not response['response']:
reply('You exceeded simsimi api daily limit!')
back = response['response']
except SimSimiException as e:
print e
if not back:
reply('Something went wrong..')
elif 'I HAVE NO RESPONSE' in back:
reply('you said something with no meaning')
else:
reply(back)
Simsimi its no more working. Any workround ?