pull
This commit is contained in:
parent
164b1288e1
commit
e1df8869fb
2 changed files with 17 additions and 8 deletions
|
@ -13,6 +13,8 @@ messages = []
|
|||
@APP.route('/', methods=['GET', 'POST'])
|
||||
def index():
|
||||
global messages
|
||||
system_prompt = 'You are a helpful assistant.'
|
||||
system = 'Your system prompt is: \"'+system_prompt+'\" The following is your chat log so far: \n'
|
||||
|
||||
if request.method == 'POST':
|
||||
option = request.form['option']
|
||||
|
@ -25,7 +27,12 @@ def index():
|
|||
elif option == "chat":
|
||||
messages.append(f"User: {user_message}")
|
||||
|
||||
ai_response = "AI: " + api.send_message(user_message, 3)
|
||||
for line in messages:
|
||||
system += line + '\n'
|
||||
|
||||
system += "The chat log is now finished."
|
||||
|
||||
ai_response = "AI: " + api.send_message(user_message, 5, system)
|
||||
messages.append(ai_response)
|
||||
|
||||
return render_template('index.html', messages=messages)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue