adiv07 commited on
Commit
cc3c9e6
·
verified ·
1 Parent(s): 4e8f98d

Update Gpt4oDemo.py

Browse files
Files changed (1) hide show
  1. Gpt4oDemo.py +2 -2
Gpt4oDemo.py CHANGED
@@ -244,12 +244,12 @@ def new_prompt(prompt):
244
 
245
  # Extract the text content from the response and append it to the chat history
246
  assistant_message = response.choices[0].message.content
247
- chat_history.append({'role': 'model', 'content': assistant_message})
248
  print(assistant_message)
249
  except Exception as e:
250
  print("Error: ",e)
251
  assistant_message = "API rate limit has been reached. Please wait a moment and try again."
252
- chat_history.append({'role': 'model', 'content': assistant_message})
253
 
254
  # except google.api_core.exceptions.ResourceExhausted:
255
  # assistant_message = "API rate limit has been reached. Please wait a moment and try again."
 
244
 
245
  # Extract the text content from the response and append it to the chat history
246
  assistant_message = response.choices[0].message.content
247
+ chat_history.append({'role': 'system', 'content': assistant_message})
248
  print(assistant_message)
249
  except Exception as e:
250
  print("Error: ",e)
251
  assistant_message = "API rate limit has been reached. Please wait a moment and try again."
252
+ chat_history.append({'role': 'system', 'content': assistant_message})
253
 
254
  # except google.api_core.exceptions.ResourceExhausted:
255
  # assistant_message = "API rate limit has been reached. Please wait a moment and try again."