feat: Handle exceptions in tactic generation
This commit is contained in:
parent
9fc035d466
commit
8196493258
|
@ -58,6 +58,7 @@ class LLMAgent(Agent):
|
||||||
new_state = None
|
new_state = None
|
||||||
for ii in range(self.n_trials):
|
for ii in range(self.n_trials):
|
||||||
print(f"===============trail {str(ii)}============")
|
print(f"===============trail {str(ii)}============")
|
||||||
|
try:
|
||||||
s = select_tactic.run(
|
s = select_tactic.run(
|
||||||
server=self.server,
|
server=self.server,
|
||||||
state=state,
|
state=state,
|
||||||
|
@ -75,6 +76,9 @@ class LLMAgent(Agent):
|
||||||
print(colored("[Tactic] Failed:", "red"), tactic)
|
print(colored("[Tactic] Failed:", "red"), tactic)
|
||||||
return None
|
return None
|
||||||
return tactic
|
return tactic
|
||||||
|
except Exception as e:
|
||||||
|
print(colored(str(e), "red"))
|
||||||
|
return None
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
self.goal_tactic_id_map[key] = i + 1
|
self.goal_tactic_id_map[key] = i + 1
|
||||||
|
|
Loading…
Reference in New Issue