prediction-market-agent-tooling 0.56.0.dev112__py3-none-any.whl → 0.56.0.dev1857__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -555,18 +555,16 @@ class DeployableTraderAgent(DeployablePredictionAgent):
555
555
  BettingStrategy.assert_trades_currency_match_markets(market, trades)
556
556
  return trades
557
557
 
558
- def before_process_market(
559
- self, market_type: MarketType, market: AgentMarket
560
- ) -> None:
561
- super().before_process_market(market_type, market)
562
- self.check_min_required_balance_to_trade(market)
563
-
564
558
  def process_market(
565
559
  self,
566
560
  market_type: MarketType,
567
561
  market: AgentMarket,
568
562
  verify_market: bool = True,
569
563
  ) -> ProcessedTradedMarket | None:
564
+ self.check_min_required_balance_to_trade(
565
+ market
566
+ ) # Do this as part of `process_market` because it observes some methods --> To keep everything traced under the `process_market`.
567
+
570
568
  processed_market = super().process_market(market_type, market, verify_market)
571
569
  if processed_market is None:
572
570
  return None
@@ -47,7 +47,7 @@ def db_cache(
47
47
  cache_none: bool = True,
48
48
  api_keys: APIKeys | None = None,
49
49
  ignore_args: Sequence[str] | None = None,
50
- ignore_arg_types: Sequence[type] | None = (APIKeys,),
50
+ ignore_arg_types: Sequence[type] | None = None,
51
51
  ) -> Callable[[FunctionT], FunctionT]:
52
52
  ...
53
53
 
@@ -60,7 +60,7 @@ def db_cache(
60
60
  cache_none: bool = True,
61
61
  api_keys: APIKeys | None = None,
62
62
  ignore_args: Sequence[str] | None = None,
63
- ignore_arg_types: Sequence[type] | None = (APIKeys,),
63
+ ignore_arg_types: Sequence[type] | None = None,
64
64
  ) -> FunctionT:
65
65
  ...
66
66
 
@@ -72,10 +72,7 @@ def db_cache(
72
72
  cache_none: bool = True,
73
73
  api_keys: APIKeys | None = None,
74
74
  ignore_args: Sequence[str] | None = None,
75
- ignore_arg_types: Sequence[type]
76
- | None = (
77
- APIKeys,
78
- ), # Ignore `APIKeys` by default from storing it in DB and using to compute look-up hash, because api keys shouldn't change the computed results.
75
+ ignore_arg_types: Sequence[type] | None = None,
79
76
  ) -> FunctionT | Callable[[FunctionT], FunctionT]:
80
77
  if func is None:
81
78
  # Ugly Pythonic way to support this decorator as `@postgres_cache` but also `@postgres_cache(max_age=timedelta(days=3))`
@@ -1,4 +1,5 @@
1
1
  import typing as t
2
+ from datetime import timedelta
2
3
 
3
4
  import tenacity
4
5
  from googleapiclient.discovery import build
@@ -13,7 +14,7 @@ from prediction_market_agent_tooling.tools.caches.db_cache import db_cache
13
14
  stop=tenacity.stop_after_attempt(3),
14
15
  after=lambda x: logger.debug(f"search_google failed, {x.attempt_number=}."),
15
16
  )
16
- @db_cache
17
+ @db_cache(max_age=timedelta(days=1))
17
18
  def search_google(
18
19
  query: str | None = None,
19
20
  num: int = 3,
@@ -1,5 +1,5 @@
1
1
  import typing as t
2
- from datetime import date
2
+ from datetime import date, timedelta
3
3
 
4
4
  import tenacity
5
5
  from tavily import TavilyClient
@@ -14,7 +14,7 @@ from prediction_market_agent_tooling.tools.tavily.tavily_models import (
14
14
  DEFAULT_SCORE_THRESHOLD = 0.75 # Based on some empirical testing, anything lower wasn't very relevant to the question being asked
15
15
 
16
16
 
17
- @db_cache
17
+ @db_cache(max_age=timedelta(days=1), ignore_args=["api_keys"])
18
18
  def tavily_search(
19
19
  query: str,
20
20
  search_depth: t.Literal["basic", "advanced"] = "advanced",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.56.0.dev112
3
+ Version: 0.56.0.dev1857
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -17,7 +17,7 @@ prediction_market_agent_tooling/benchmark/agents.py,sha256=B1-uWdyeN4GGKMWGK_-Cc
17
17
  prediction_market_agent_tooling/benchmark/benchmark.py,sha256=MqTiaaJ3cYiOLUVR7OyImLWxcEya3Rl5JyFYW-K0lwM,17097
18
18
  prediction_market_agent_tooling/benchmark/utils.py,sha256=D0MfUkVZllmvcU0VOurk9tcKT7JTtwwOp-63zuCBVuc,2880
19
19
  prediction_market_agent_tooling/config.py,sha256=114f3V9abaok27p5jX3UVr5b5gRUiSxBIYn8Snid34I,6731
20
- prediction_market_agent_tooling/deploy/agent.py,sha256=5jIZ_Wqj9XALGINCkFp2bkNV33bAnUQ_r9oNGrNgDmA,22654
20
+ prediction_market_agent_tooling/deploy/agent.py,sha256=v6jnk8gY_ckF_Z8Slj408RLBadC5cZwx_nqV02TiThU,22642
21
21
  prediction_market_agent_tooling/deploy/agent_example.py,sha256=dIIdZashExWk9tOdyDjw87AuUcGyM7jYxNChYrVK2dM,1001
22
22
  prediction_market_agent_tooling/deploy/betting_strategy.py,sha256=kMrIE3wMv_IB6nJd_1DmDXDkEZhsXFOgyTd7JZ0gqHI,13068
23
23
  prediction_market_agent_tooling/deploy/constants.py,sha256=M5ty8URipYMGe_G-RzxRydK3AFL6CyvmqCraJUrLBnE,82
@@ -69,13 +69,13 @@ prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256
69
69
  prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py,sha256=-FUSuQQgjcWSSnoFxnlAyTeilY6raJABJVM2QKkFqAY,438
70
70
  prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py,sha256=THMXwFlskvzbjnX_OiYtDSzI8XVFyULWfP2525_9UGc,429
71
71
  prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=kpIb-ci67Vc1Yqqaa-_S4OUkbhWSIYog4_Iwp69HU_k,97
72
- prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=t07HdllA0yHHp-ZFjytwb1XB4M6cO4ZxRwme0ZDWrQ8,12049
72
+ prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=xJ9zIXCUm0SaHbzWJOk61pGJaZZxCnIVSzpjIx1TxWY,11869
73
73
  prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=tGHHd9HCiE_hCCtPtloHZQdDfBuiow9YsqJNYi2Tx_0,499
74
74
  prediction_market_agent_tooling/tools/contract.py,sha256=s3yo8IbXTcvAJcPfLM0_NbgaEsWwLsPmyVnOgyjq_xI,20919
75
75
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
76
76
  prediction_market_agent_tooling/tools/datetime_utc.py,sha256=2JSWF7AXQnv04_D_cu9Vmdkq0TWmGJ1QcK9AeqrA-U8,2765
77
77
  prediction_market_agent_tooling/tools/gnosis_rpc.py,sha256=ctBfB1os-MvZ1tm0Rwdyn9b3dvFnlM9naKvZmzywc3A,197
78
- prediction_market_agent_tooling/tools/google.py,sha256=UMJg7hyIDoG4lY2jtcRPAxj-EfnaIXLaBgzTST-v_qc,1770
78
+ prediction_market_agent_tooling/tools/google.py,sha256=jwXhu4lKfF0cuu02fMX-mGCRntRgiGQWkZ2CstaprK4,1828
79
79
  prediction_market_agent_tooling/tools/hexbytes_custom.py,sha256=Bp94qgPjvjWf1Vb4lNzGFDXRdThw1rJ91vL6r2PWq5E,2096
80
80
  prediction_market_agent_tooling/tools/httpx_cached_client.py,sha256=0-N1r0zcGKlY9Rk-Ab8hbqwc54eMbsoa3jXL0_yCCiM,355
81
81
  prediction_market_agent_tooling/tools/image_gen/image_gen.py,sha256=HzRwBx62hOXBOmrtpkXaP9Qq1Ku03uUGdREocyjLQ_k,1266
@@ -94,11 +94,11 @@ prediction_market_agent_tooling/tools/safe.py,sha256=9vxGGLvSPnfy-sxUFDpBTe8omqp
94
94
  prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0rnVhtQGzwoUdAgn_7u_GBM,729
95
95
  prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9QtliwSGRASIz1opjQ7Btme43H4qJbzgE,3010
96
96
  prediction_market_agent_tooling/tools/tavily/tavily_models.py,sha256=5ldQs1pZe6uJ5eDAuP4OLpzmcqYShlIV67kttNFvGS0,342
97
- prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=oMlhJfFxFoE6jvTtnCRmyllvoC3tuAtD8h5C5T5f3mw,3745
97
+ prediction_market_agent_tooling/tools/tavily/tavily_search.py,sha256=Kw2mXNkMTYTEe1MBSTqhQmLoeXtgb6CkmHlcAJvhtqE,3809
98
98
  prediction_market_agent_tooling/tools/utils.py,sha256=W-9SqeCKd51BYMRhDjYPQ7lfNO_zE9EvYpmu2r5WXGA,7163
99
99
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=44W8siSLNQxeib98bbwAe7V5C609NHNlUuxwuWIRDiY,11838
100
- prediction_market_agent_tooling-0.56.0.dev112.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
101
- prediction_market_agent_tooling-0.56.0.dev112.dist-info/METADATA,sha256=UieSLwmEqLzVfN9v_iTN2aSk2_C38hFCgUVa2au8-h8,8113
102
- prediction_market_agent_tooling-0.56.0.dev112.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
103
- prediction_market_agent_tooling-0.56.0.dev112.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
104
- prediction_market_agent_tooling-0.56.0.dev112.dist-info/RECORD,,
100
+ prediction_market_agent_tooling-0.56.0.dev1857.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
101
+ prediction_market_agent_tooling-0.56.0.dev1857.dist-info/METADATA,sha256=NIqgq3qamRLZkjkxDNi0EJm2RdB3drSCIYgP683-JQY,8114
102
+ prediction_market_agent_tooling-0.56.0.dev1857.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
103
+ prediction_market_agent_tooling-0.56.0.dev1857.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
104
+ prediction_market_agent_tooling-0.56.0.dev1857.dist-info/RECORD,,