From a1931b8be64cbc858a139059279b971485064358 Mon Sep 17 00:00:00 2001 From: Peter Jung Date: Fri, 11 Oct 2024 12:18:00 +0200 Subject: [PATCH] Do not replicate invalid markets (#512) --- .../agents/replicate_to_omen_agent/omen_replicate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py b/prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py index feafa50..3411896 100644 --- a/prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py +++ b/prediction_market_agent/agents/replicate_to_omen_agent/omen_replicate.py @@ -29,6 +29,7 @@ from prediction_market_agent_tooling.markets.omen.omen_subgraph_handler import ( OmenSubgraphHandler, ) +from prediction_market_agent_tooling.tools.is_invalid import is_invalid from prediction_market_agent_tooling.tools.is_predictable import ( is_predictable_binary, is_predictable_without_description, @@ -128,6 +129,12 @@ def omen_replicate_from_tx( continue # Do as the last steps, becuase it calls OpenAI (costly & slow). + if is_invalid(market.question): + logger.info( + f"Skipping `{market.question}` because it seems to be an invalid question." + ) + continue + if not is_predictable_binary(market.question): logger.info( f"Skipping `{market.question}` because it seems to not be predictable."