Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,9 +41,9 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 41 |
|
| 42 |
time.sleep(5) # This pauses the function for the alloted amount of time (ex: time.sleep(5) -> pause for 5 seconds) *this doesnt account for the time it takes for the bot to create a response, so the bots overall response time will be noticably higher than the amount of time you put in*
|
| 43 |
|
| 44 |
-
create_prompt = openai.ChatCompletion.create( #
|
| 45 |
model = "gpt-4o", # Change the message in the qoutes to change the model. Note: it must be a recognized model by openai's api (case sensetive).
|
| 46 |
-
messages = user_dictionary[user_id]
|
| 47 |
)
|
| 48 |
|
| 49 |
reply_prompt = create_prompt.choices[0].message.content # Variable for the reply prompt.
|
|
|
|
| 41 |
|
| 42 |
time.sleep(5) # This pauses the function for the alloted amount of time (ex: time.sleep(5) -> pause for 5 seconds) *this doesnt account for the time it takes for the bot to create a response, so the bots overall response time will be noticably higher than the amount of time you put in*
|
| 43 |
|
| 44 |
+
create_prompt = openai.ChatCompletion.create( #Asking openai for a prompt based on the current message history.
|
| 45 |
model = "gpt-4o", # Change the message in the qoutes to change the model. Note: it must be a recognized model by openai's api (case sensetive).
|
| 46 |
+
messages = user_dictionary[user_id]
|
| 47 |
)
|
| 48 |
|
| 49 |
reply_prompt = create_prompt.choices[0].message.content # Variable for the reply prompt.
|