Merge pull request 'OOPified.' (#9) from React-Group/ai-virtual-assistant:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/YasinOnm08/ai-virtual-assistant/pulls/9
This commit is contained in:
commit
eb7ad5fb98
2 changed files with 30 additions and 24 deletions
|
@ -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)
|
||||||
|
|
|
@ -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)
|
|
||||||
|
|
Reference in a new issue