fix: Filter invalid messages
This commit is contained in:
parent
cd05b67c10
commit
9fc035d466
|
@ -1,5 +1,6 @@
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
import collections, unittest
|
import collections, unittest
|
||||||
|
from termcolor import colored
|
||||||
from pantograph.search import Agent
|
from pantograph.search import Agent
|
||||||
from pantograph.server import Server, TacticFailure, ServerError
|
from pantograph.server import Server, TacticFailure, ServerError
|
||||||
from pantograph.expr import Expr, Tactic, GoalState
|
from pantograph.expr import Expr, Tactic, GoalState
|
||||||
|
@ -70,6 +71,9 @@ class LLMAgent(Agent):
|
||||||
|
|
||||||
print("\n-- new state --\n", new_state)
|
print("\n-- new state --\n", new_state)
|
||||||
if tactic:
|
if tactic:
|
||||||
|
if not isinstance(tactic, Tactic):
|
||||||
|
print(colored("[Tactic] Failed:", "red"), tactic)
|
||||||
|
return None
|
||||||
return tactic
|
return tactic
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue