simple_chat, voice_recognition #22

Merged
Patrick_Pluto merged 6 commits from YasinOnm08/ai-virtual-assistant:main into main 2024-09-16 14:39:33 +02:00
2 changed files with 30 additions and 24 deletions
Showing only changes of commit eb7ad5fb98 - Show all commits

View file

@ -1,20 +1,24 @@
from api import API from api import API
chat1 = API()
while True: class CLIChat:
print("") @staticmethod
print("Which AI Model do you want to use? Write as a Number (1-5)") def chat():
model_input = input() chat1 = API()
model = int(model_input)
if model <=0 or model > 5: while True:
print("ungültiges Modell") print("")
continue print("Which AI Model do you want to use? Write as a Number (1-5).")
while True: model_input = input()
print("") model = int(model_input)
print("Ask a question") if model <= 0 or model > 5:
inputText = input () print("Invalid model.")
if inputText == "change": continue
break while True:
outputText = chat1.send_message(inputText, model) print("")
print(outputText) print("Ask a question")
input_text = input()
if input_text == "change":
break
output_text = chat1.send_message(input_text, model)
print(output_text)

View file

@ -1,12 +1,14 @@
from flask import Flask, send_from_directory from flask import Flask, send_from_directory
app = Flask(__name__)
class WebHost:
@staticmethod
def main_page():
app = Flask(__name__)
@app.route('/') @app.route('/')
def index(): def index():
return app.send_static_file('index.html') return app.send_static_file('index.html')
if __name__ == '__main__':
if __name__ == '__main__': app.run(debug=True)
app.run(debug=True)