Compare commits

..

No commits in common. "c011383f0e19cb1fc44ea7ce5e2ba1ce76744433" and "161abdf32e22244ddcd314b1be3fb147e823d981" have entirely different histories.

View File

@ -4,8 +4,9 @@ import scraper_functions as sf
def processmsg(msg, rcpt): def processmsg(msg, rcpt):
if "youtube.com/watch" in msg: if "youtube.com/watch" in msg:
return msg.replace("youtube.com", "iv.datura.network") return msg.replace("youtube.com", "iv.datura.network")
elif msg.startswith("!"): elif msg.startswith("!wiki"):
return command(msg) cmd, query = msg.split(" ", 1)
return sf.query_external_website("https://en.wikipedia.org", "/wiki/" + query)
elif "good bot" in msg: elif "good bot" in msg:
return "^_^" return "^_^"
@ -20,7 +21,4 @@ def command(msg, rcpt):
client = ollama.Client(host='https://ollama.krov.dmz.rs') client = ollama.Client(host='https://ollama.krov.dmz.rs')
response = client.chat(model='llama2-uncensored:latest', messages=[{'role':'user','content':f'{msg[4:]}'}]) response = client.chat(model='llama2-uncensored:latest', messages=[{'role':'user','content':f'{msg[4:]}'}])
return(response['message']['content']) return(response['message']['content'])
elif msg.startswith("!wiki"):
cmd, query = msg.split(" ", 1)
return sf.query_external_website("https://en.wikipedia.org", "/wiki/" + query)