Skip to content

Commit

Permalink
Tweak to lanfguse trace script (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
evangriffiths authored Nov 4, 2024
1 parent 50b9f78 commit a50b00f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/monitor/match_bets_with_langfuse_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def get_outcome_for_trace(
api_keys = APIKeys(BET_FROM_PRIVATE_KEY=private_key)

# Pick a time after pool token number is stored in OmenAgentMarket
start_time = utc_datetime(2024, 9, 13)
start_time = utc_datetime(2024, 10, 1)

langfuse = Langfuse(
secret_key=api_keys.langfuse_secret_key.get_secret_value(),
Expand Down Expand Up @@ -206,6 +206,10 @@ def get_outcome_for_trace(
bets_with_traces.append(ResolvedBetWithTrace(bet=bet, trace=trace))

print(f"Number of bets since {start_time}: {len(bets_with_traces)}\n")

if len(bets_with_traces) == 0:
continue

if len(bets_with_traces) != len(bets):
print(
f"{len(bets) - len(bets_with_traces)} bets do not have a corresponding trace, ignoring them."
Expand Down

0 comments on commit a50b00f

Please sign in to comment.