This repository has been archived on 2024-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
ai-virtual-assistant/py/simple_chat.py

24 lines
691 B
Python
Raw Normal View History

2024-09-16 11:59:15 +02:00
from api import API
2024-09-16 11:21:09 +02:00
2024-09-16 13:44:48 +02:00
class CLIChat:
@staticmethod
def chat():
chat1 = API()
while True:
print("")
print("Which AI Model do you want to use? Write as a Number (1-5).")
model_input = input()
model = int(model_input)
if model <= 0 or model > 5:
print("Invalid model.")
continue
while True:
print("")
print("Ask a question")
input_text = input()
if input_text == "change":
break
output_text = chat1.send_message(input_text, model)
print(output_text)