Skip to content

Commit

Permalink
better handling of empty response in browser agent
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Sep 10, 2024
1 parent 64cb73f commit 2b007be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/browser/siteuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ def site_use(prompt, current):
completion = OpenAI().chat.completions.create(model = "gpt-4", messages = messages)
content = completion.choices[0].message.content
extracted = h9.extract(content, language = "*")
if len(extracted) == 0:
if not extracted or len(extracted) == 0:
return content
return extracted

0 comments on commit 2b007be

Please sign in to comment.