Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Info logs about market process progress #407

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions prediction_market_agent_tooling/deploy/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ def process_market(
market: AgentMarket,
verify_market: bool = True,
) -> ProcessedMarket | None:
logger.info(f"Processing market {market.question=} from {market.url=}.")

self.before_process_market(market_type, market)

if verify_market and not self.verify_market(market_type, market):
Expand Down Expand Up @@ -462,6 +464,7 @@ def process_market(
processed_market = ProcessedMarket(answer=answer, trades=trades)
self.update_langfuse_trace_by_processed_market(market_type, processed_market)

logger.info(f"Processed market {market.question=} from {market.url=}.")
return processed_market

def after_process_market(
Expand Down Expand Up @@ -495,7 +498,11 @@ def process_markets(self, market_type: MarketType) -> None:
"""
Processes bets placed by agents on a given market.
"""
logger.info("Start processing of markets.")
available_markets = self.get_markets(market_type)
logger.info(
f"Fetched {len(available_markets)=} markets to process, going to process {self.bet_on_n_markets_per_run=}."
)
processed = 0

for market in available_markets:
Expand All @@ -510,6 +517,8 @@ def process_markets(self, market_type: MarketType) -> None:
if processed == self.bet_on_n_markets_per_run:
break

logger.info(f"All markets processed.")
kongzii marked this conversation as resolved.
Show resolved Hide resolved

def after_process_markets(self, market_type: MarketType) -> None:
pass

Expand Down
Loading