ver Feb1st
human evaluation and SoM experiments on Thunderbird
This commit is contained in:
@@ -460,14 +460,18 @@ class GPT4v_Agent:
|
||||
with open("messages.json", "w") as f:
|
||||
f.write(json.dumps(messages, indent=4))
|
||||
|
||||
response = self.call_llm({
|
||||
"model": self.model,
|
||||
"messages": messages,
|
||||
"max_tokens": self.max_tokens
|
||||
})
|
||||
try:
|
||||
response = self.call_llm({
|
||||
"model": self.model,
|
||||
"messages": messages,
|
||||
"max_tokens": self.max_tokens
|
||||
})
|
||||
except:
|
||||
response = ""
|
||||
|
||||
logger.debug("RESPONSE: %s", response)
|
||||
|
||||
# {{{
|
||||
if self.exp == "seeact":
|
||||
messages.append({
|
||||
"role": "assistant",
|
||||
@@ -503,7 +507,7 @@ class GPT4v_Agent:
|
||||
except Exception as e:
|
||||
print("Failed to parse action from response", e)
|
||||
actions = None
|
||||
self.thoughts.append("")
|
||||
self.thoughts.append("") # }}}
|
||||
|
||||
return actions
|
||||
|
||||
@@ -516,7 +520,8 @@ class GPT4v_Agent:
|
||||
response = requests.post(
|
||||
"https://api.openai.com/v1/chat/completions",
|
||||
headers=self.headers,
|
||||
json=payload
|
||||
json=payload,
|
||||
timeout=20
|
||||
)
|
||||
|
||||
if response.status_code != 200:
|
||||
|
||||
Reference in New Issue
Block a user