Skip to content

Commit

Permalink
Skip failed predictions in known outcome agent
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii committed Mar 26, 2024
1 parent 8950868 commit 5566929
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions prediction_market_agent/agents/known_outcome_agent/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ def pick_markets(self, markets: list[AgentMarket]) -> list[AgentMarket]:
print(f"Looking at market {market.id=} {market.question=}")
if not market_is_saturated(market=market):
print(f"Predicting market {market.id=} {market.question=}")
answer = get_known_outcome(
model=self.model,
question=market.question,
max_tries=3,
)
try:
answer = get_known_outcome(
model=self.model,
question=market.question,
max_tries=3,
)
except Exception as e:
print(
f"Error: Failed to predict market {market.id=} {market.question=}: {e}"
)
continue
if answer.has_known_outcome():
print(
f"Picking market {market.id=} {market.question=} with answer {answer.result=}"
Expand Down

0 comments on commit 5566929

Please sign in to comment.