Samuel L Meyers commited on
Commit
f0247b1
·
1 Parent(s): de64869

Adjust text retrieval

Browse files
Files changed (1) hide show
  1. code/app.py +2 -2
code/app.py CHANGED
@@ -78,9 +78,9 @@ def talk(txt, jsn):
78
  for r in result:
79
  print("GOT RESULT:", r)
80
  txt2 = None
81
- if "content" in r["choices"][0]["text"]:
82
  txt2 = r["choices"][0]["text"]
83
- elif not "text" in r["choices"][0] and not r["choices"][0]["finish_reason"]:
84
  running = False
85
  yield txt
86
  if txt2 is not None:
 
78
  for r in result:
79
  print("GOT RESULT:", r)
80
  txt2 = None
81
+ if "text" in r["choices"][0]:
82
  txt2 = r["choices"][0]["text"]
83
+ elif not "text" in r["choices"][0] and not "role" in r["choices"][0]:
84
  running = False
85
  yield txt
86
  if txt2 is not None: