forked from Decentrala/chatbot
add ollama command
This commit is contained in:
parent
a8b9850be5
commit
c2286ae0a6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
config.ini
|
config.ini
|
||||||
|
venv/
|
||||||
__pycache__
|
__pycache__
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import ollama
|
||||||
|
|
||||||
def processmsg(msg, rcpt):
|
def processmsg(msg, rcpt):
|
||||||
if msg.startswith("!"):
|
if msg.startswith("!"):
|
||||||
return command(msg, rcpt)
|
return command(msg, rcpt)
|
||||||
@ -7,3 +9,8 @@ def processmsg(msg, rcpt):
|
|||||||
def command(msg, rcpt):
|
def command(msg, rcpt):
|
||||||
if msg.startswith("!help"):
|
if msg.startswith("!help"):
|
||||||
return "chatbot commands: \n" + "!help Show this help page"
|
return "chatbot commands: \n" + "!help Show this help page"
|
||||||
|
elif msg.startswith("!ai"):
|
||||||
|
client = ollama.Client(host='https://ollama.krov.dmz.rs')
|
||||||
|
response = client.chat(model='llama2-uncensored:latest', messages=[{'role':'user','content':f'{msg[4:]}'}])
|
||||||
|
return(response['message']['content'])
|
||||||
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
slixmpp
|
slixmpp
|
||||||
|
ollama
|
||||||
|
Loading…
Reference in New Issue
Block a user