prediction-market-agent-tooling 0.56.0.dev112__py3-none-any.whl → 0.56.0.dev113__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.
@@ -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.dev113
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -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.dev113.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
101
+ prediction_market_agent_tooling-0.56.0.dev113.dist-info/METADATA,sha256=u9ZsAzD8yLPWsVdefl84VAyLTvhFI8D4lxRooHqnBRU,8113
102
+ prediction_market_agent_tooling-0.56.0.dev113.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
103
+ prediction_market_agent_tooling-0.56.0.dev113.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
104
+ prediction_market_agent_tooling-0.56.0.dev113.dist-info/RECORD,,