gerasdf commited on
Commit
0da928c
·
verified ·
1 Parent(s): f118261

yield makes generators

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,7 +8,6 @@ api_key = os.getenv("OPENAI_APIKEY")
8
 
9
 
10
  def chat(message, history):
11
-
12
  history_openai_format = []
13
  for human, assistant in history:
14
  history_openai_format.append({"role": "user", "content": human })
@@ -17,6 +16,8 @@ def chat(message, history):
17
  history_openai_format.append({"role": "user", "content": message['text']})
18
 
19
  return f"{history}\n----\n{message}\n----\n{history_openai_format}"
 
 
20
  response = client.chat.completions.create(
21
  model='gpt-3.5-turbo',
22
  messages= history_openai_format,
 
8
 
9
 
10
  def chat(message, history):
 
11
  history_openai_format = []
12
  for human, assistant in history:
13
  history_openai_format.append({"role": "user", "content": human })
 
16
  history_openai_format.append({"role": "user", "content": message['text']})
17
 
18
  return f"{history}\n----\n{message}\n----\n{history_openai_format}"
19
+
20
+ def comment():
21
  response = client.chat.completions.create(
22
  model='gpt-3.5-turbo',
23
  messages= history_openai_format,