prediction-market-agent-tooling 0.48.3__py3-none-any.whl → 0.48.5__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.
@@ -3,4 +3,4 @@ import os
3
3
  from prediction_market_agent_tooling.gtypes import ChainID
4
4
 
5
5
  GNOSIS_NETWORK_ID = ChainID(100) # xDai network.
6
- GNOSIS_RPC_URL = os.getenv("GNOSIS_RPC_URL", "https://gnosis-rpc.publicnode.com")
6
+ GNOSIS_RPC_URL = os.getenv("GNOSIS_RPC_URL", "https://rpc.gnosischain.com")
@@ -15,7 +15,7 @@ class TavilyResult(BaseModel):
15
15
  url: str
16
16
  content: str
17
17
  score: float
18
- raw_content: str
18
+ raw_content: str | None
19
19
 
20
20
 
21
21
  class TavilyResponse(BaseModel):
@@ -60,9 +60,7 @@ def tavily_search(
60
60
  return response_parsed
61
61
 
62
62
 
63
- @tenacity.retry(
64
- stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_fixed(1), reraise=True
65
- )
63
+ @tenacity.retry(stop=tenacity.stop_after_attempt(3), wait=tenacity.wait_fixed(1))
66
64
  def _tavily_search(
67
65
  query: str,
68
66
  search_depth: t.Literal["basic", "advanced"],
@@ -28,6 +28,7 @@ from prediction_market_agent_tooling.loggers import logger
28
28
  ONE_NONCE = Nonce(1)
29
29
  ONE_XDAI = xdai_type(1)
30
30
  ZERO_BYTES = HexBytes(HASH_ZERO)
31
+ NOT_REVERTED_ICASE_REGEX_PATTERN = "(?i)(?!.*reverted.*)"
31
32
 
32
33
 
33
34
  def private_key_to_public_key(private_key: SecretStr) -> ChecksumAddress:
@@ -154,11 +155,8 @@ def _prepare_tx_params(
154
155
 
155
156
 
156
157
  @tenacity.retry(
157
- # Retry only for the transaction errors that match the given patterns,
158
- # add other retrieable errors gradually to be safe.
159
- retry=tenacity.retry_if_exception_message(
160
- match="(.*wrong transaction nonce.*)|(.*Invalid.*)|(.*OldNonce.*)"
161
- ),
158
+ # Don't retry on `reverted` messages, as they would always fail again.
159
+ retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
162
160
  wait=tenacity.wait_chain(*[tenacity.wait_fixed(n) for n in range(1, 10)]),
163
161
  stop=tenacity.stop_after_attempt(9),
164
162
  after=lambda x: logger.debug(
@@ -194,11 +192,8 @@ def send_function_on_contract_tx(
194
192
 
195
193
 
196
194
  @tenacity.retry(
197
- # Retry only for the transaction errors that match the given patterns,
198
- # add other retrieable errors gradually to be safe.
199
- retry=tenacity.retry_if_exception_message(
200
- match="(.*wrong transaction nonce.*)|(.*Invalid.*)|(.*OldNonce.*)"
201
- ),
195
+ # Don't retry on `reverted` messages, as they would always fail again.
196
+ retry=tenacity.retry_if_exception_message(match=NOT_REVERTED_ICASE_REGEX_PATTERN),
202
197
  wait=tenacity.wait_chain(*[tenacity.wait_fixed(n) for n in range(1, 10)]),
203
198
  stop=tenacity.stop_after_attempt(9),
204
199
  after=lambda x: logger.debug(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.48.3
3
+ Version: 0.48.5
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -62,7 +62,7 @@ prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py,
62
62
  prediction_market_agent_tooling/tools/cache.py,sha256=tGHHd9HCiE_hCCtPtloHZQdDfBuiow9YsqJNYi2Tx_0,499
63
63
  prediction_market_agent_tooling/tools/contract.py,sha256=d6eR1CSSKRxyM-zgUtp5jmj3z8nAfwTdtiTGWjzlvYU,19388
64
64
  prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_oEO_H16jRVCdoZ93Uw,954
65
- prediction_market_agent_tooling/tools/gnosis_rpc.py,sha256=_MYSoyOR2MgAJkop1ERf8RhLum-M8S6OjaAsaqUW41w,203
65
+ prediction_market_agent_tooling/tools/gnosis_rpc.py,sha256=ctBfB1os-MvZ1tm0Rwdyn9b3dvFnlM9naKvZmzywc3A,197
66
66
  prediction_market_agent_tooling/tools/google.py,sha256=SfVDxb3oEOUK8mpd0l3mTX9ybrdrTPNM6HjfJ7kfNjA,1794
67
67
  prediction_market_agent_tooling/tools/hexbytes_custom.py,sha256=Bp94qgPjvjWf1Vb4lNzGFDXRdThw1rJ91vL6r2PWq5E,2096
68
68
  prediction_market_agent_tooling/tools/image_gen/image_gen.py,sha256=HzRwBx62hOXBOmrtpkXaP9Qq1Ku03uUGdREocyjLQ_k,1266
@@ -73,12 +73,12 @@ prediction_market_agent_tooling/tools/parallelism.py,sha256=Rz8QdVUWX8KCbr8UZfaC
73
73
  prediction_market_agent_tooling/tools/safe.py,sha256=h0xOO0eNtitClf0fPkn-0oTc6A_bflDTee98V_aiV-A,5195
74
74
  prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0rnVhtQGzwoUdAgn_7u_GBM,729
75
75
  prediction_market_agent_tooling/tools/streamlit_user_login.py,sha256=NXEqfjT9Lc9QtliwSGRASIz1opjQ7Btme43H4qJbzgE,3010
76
- prediction_market_agent_tooling/tools/tavily_storage/tavily_models.py,sha256=qIpzeJvPRBfKn1Bi8aNMDQg9A5WXxIVSq8e5LmeHfOY,4370
77
- prediction_market_agent_tooling/tools/tavily_storage/tavily_storage.py,sha256=QLcDiYIdtJPxvHlRODSjt9GH3WqWCEmODr4C7SpaMAg,3214
76
+ prediction_market_agent_tooling/tools/tavily_storage/tavily_models.py,sha256=dr-N-G67f4au6s5xLwZPNbKhe4BFaEuYpQTn0KZ4EKg,4377
77
+ prediction_market_agent_tooling/tools/tavily_storage/tavily_storage.py,sha256=eln3BygdfsDf8WOlSQPL7qH946QnGnThRkazRZKBA8o,3194
78
78
  prediction_market_agent_tooling/tools/utils.py,sha256=JE9YWtPPhnTgLiOyGAZDNG5K8nCwUY9IZEuAlm9UcxA,6611
79
- prediction_market_agent_tooling/tools/web3_utils.py,sha256=nKRHmdLnWSKd3wpo-cysXGvhhrJ2Yf69sN2FFQfSt6s,10578
80
- prediction_market_agent_tooling-0.48.3.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
81
- prediction_market_agent_tooling-0.48.3.dist-info/METADATA,sha256=XUpEomqGaOVnpdAdbxo3epu8txOirjxSDYSlOh_qPhs,7810
82
- prediction_market_agent_tooling-0.48.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
83
- prediction_market_agent_tooling-0.48.3.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
84
- prediction_market_agent_tooling-0.48.3.dist-info/RECORD,,
79
+ prediction_market_agent_tooling/tools/web3_utils.py,sha256=euq_MH-LhTowACq42colks2IXxZQjqjuisYl91EYZtU,10440
80
+ prediction_market_agent_tooling-0.48.5.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
81
+ prediction_market_agent_tooling-0.48.5.dist-info/METADATA,sha256=T6nk1eHBTZTrt6UXFqHHb2gPP7K_2TEe_orSRBQIuCM,7810
82
+ prediction_market_agent_tooling-0.48.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
83
+ prediction_market_agent_tooling-0.48.5.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
84
+ prediction_market_agent_tooling-0.48.5.dist-info/RECORD,,