prediction-market-agent-tooling 0.64.2.dev603__py3-none-any.whl → 0.64.2.dev604__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,6 +3,7 @@ import inspect
3
3
  import json
4
4
  from datetime import timedelta
5
5
  from functools import wraps
6
+ from types import UnionType
6
7
  from typing import (
7
8
  Any,
8
9
  Callable,
@@ -276,6 +277,17 @@ def convert_cached_output_to_pydantic(return_type: Any, data: Any) -> Any:
276
277
  ): convert_cached_output_to_pydantic(value_type, v)
277
278
  for k, v in data.items()
278
279
  }
280
+ # If the origin is a union and one of the unions is basemodel, convert it to it.
281
+ elif (
282
+ origin is UnionType
283
+ and (
284
+ base_model_from_args := next(
285
+ (x for x in args if issubclass(x, BaseModel)), None
286
+ )
287
+ )
288
+ is not None
289
+ ):
290
+ return base_model_from_args.model_validate(data)
279
291
  else:
280
292
  # If the origin is not a dictionary, return the data as is
281
293
  return data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.64.2.dev603
3
+ Version: 0.64.2.dev604
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.13
@@ -86,7 +86,7 @@ prediction_market_agent_tooling/tools/betting_strategies/market_moving.py,sha256
86
86
  prediction_market_agent_tooling/tools/betting_strategies/minimum_bet_to_win.py,sha256=-FUSuQQgjcWSSnoFxnlAyTeilY6raJABJVM2QKkFqAY,438
87
87
  prediction_market_agent_tooling/tools/betting_strategies/stretch_bet_between.py,sha256=THMXwFlskvzbjnX_OiYtDSzI8XVFyULWfP2525_9UGc,429
88
88
  prediction_market_agent_tooling/tools/betting_strategies/utils.py,sha256=68zFWUj43GUaSpOPowVrbI-t6qbCE29RsVHNzCVuJ9U,175
89
- prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=dB8LNs2JvVRaFCeAKRmIQRwiirsMgtL31he8051wM-g,11431
89
+ prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=e7CLFPTlxYFx0pM3x5sWyn_g9pIigPSvrP0mMmiOhUg,11859
90
90
  prediction_market_agent_tooling/tools/caches/inmemory_cache.py,sha256=ZW5iI5rmjqeAebu5T7ftRnlkxiL02IC-MxCfDB80x7w,1506
91
91
  prediction_market_agent_tooling/tools/caches/serializers.py,sha256=vFDx4fsPxclXp2q0sv27j4al_M_Tj9aR2JJP-xNHQXA,2151
92
92
  prediction_market_agent_tooling/tools/contract.py,sha256=Yex8MVYvdBTMZLESLqKpwEyT8EGAfkJRri5kCaPqrBM,21235
@@ -124,8 +124,8 @@ prediction_market_agent_tooling/tools/tokens/usd.py,sha256=yuW8iPPtcpP4eLH2nORMD
124
124
  prediction_market_agent_tooling/tools/transaction_cache.py,sha256=K5YKNL2_tR10Iw2TD9fuP-CTGpBbZtNdgbd0B_R7pjg,1814
125
125
  prediction_market_agent_tooling/tools/utils.py,sha256=AC2a68jwASMWuQi-w8twl8b_M52YwrEJ81abmuEaqMY,6661
126
126
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=zRq-eeBGWt8uUGN9G_WfjmJ0eVvO8aWE9S0Pz_Y6AOA,12342
127
- prediction_market_agent_tooling-0.64.2.dev603.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
128
- prediction_market_agent_tooling-0.64.2.dev603.dist-info/METADATA,sha256=SPD7ax9Sdd7xI70-SypOdJzFqGvgNaLfvs7HT7biO6w,8697
129
- prediction_market_agent_tooling-0.64.2.dev603.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
130
- prediction_market_agent_tooling-0.64.2.dev603.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
131
- prediction_market_agent_tooling-0.64.2.dev603.dist-info/RECORD,,
127
+ prediction_market_agent_tooling-0.64.2.dev604.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
128
+ prediction_market_agent_tooling-0.64.2.dev604.dist-info/METADATA,sha256=38NbTGoeHosQDE-geyMz6TINHrmiaueopsL_J1-ZU2g,8697
129
+ prediction_market_agent_tooling-0.64.2.dev604.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
130
+ prediction_market_agent_tooling-0.64.2.dev604.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
131
+ prediction_market_agent_tooling-0.64.2.dev604.dist-info/RECORD,,