MCPcopy
hub / github.com/nat/natbot / get_gpt_command

Function get_gpt_command

natbot.py:554–561  ·  view source on GitHub ↗
(objective, url, previous_command, browser_content)

Source from the content-addressed store, hash-verified

552 )
553
554 def get_gpt_command(objective, url, previous_command, browser_content):
555 prompt = prompt_template
556 prompt = prompt.replace("$objective", objective)
557 prompt = prompt.replace("$url", url[:100])
558 prompt = prompt.replace("$previous_command", previous_command)
559 prompt = prompt.replace("$browser_content", browser_content[:4500])
560 response = openai.Completion.create(model="text-davinci-002", prompt=prompt, temperature=0.5, best_of=10, n=3, max_tokens=50)
561 return response.choices[0].text
562
563 def run_cmd(cmd):
564 cmd = cmd.split("\n")[0]

Callers 1

natbot.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected