This commit is contained in:
2025-02-12 10:53:44 -06:00
parent 79c696c0a1
commit 62bec63cc9
2 changed files with 36 additions and 11 deletions

View File

@@ -19,6 +19,8 @@
buildInputs = with pkgs; [
(python311.withPackages (ps: with ps; [
ollama
tkinter
customtkinter
]))
];

View File

@@ -1,23 +1,46 @@
import ollama
import sys
import customtkinter as ctk
client = ollama.Client(
class App(ctk.CTk):
def __init__(self):
super().__init__()
self.geometry('600x500')
self.title('Siren')
def chat():
return client.chat(model=model, messages=messages)['message']['content']
if __name__ == '__main__':
client = ollama.Client(
host='https://ollama.blunkall.us'
)
messages = []
messages = []
response = ''
response = ''
model = 'llama3.2'
model = 'llama3.2'
userInput = ''
userInput = ''
print('Enter a prompt!')
gui = False
while(userInput != 'stop'):
userInput = input()
if(userInput != 'stop'):
messages += [{ 'role': 'user', 'content': userInput, 'stream': False }]
print(client.chat(model=model, messages=messages)['message']['content'])
for a in sys.argv:
if a == '--gui':
gui = True
print('Enter a prompt!')
while(gui == False and userInput != 'stop'):
userInput = input()
if(userInput != 'stop'):
messages += [{ 'role': 'user', 'content': userInput, 'stream': False }]
print(chat())
if(gui):
app = App()
app.mainloop()