Skip to content

Commit

Permalink
use openai for browser agent code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
javierluraschi committed Sep 10, 2024
1 parent 1c92c07 commit a36007e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/browser/siteuse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import hal9 as h9
from groq import Groq
from openai import OpenAI

system_prompt = """
Only write python code using selenium to perform the user request. The code will be run dynamically with eval().
Expand All @@ -22,7 +22,7 @@ def site_use(prompt, current):
{ "role": "system", "content": system_prompt},
{ "role": "user", "content": f"Driver alredy in page {current}. User requests: {prompt}" }
]
completion = Groq().chat.completions.create(model = "llama3-70b-8192", messages = messages)
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:
Expand Down

0 comments on commit a36007e

Please sign in to comment.