prediction-market-agent-tooling 0.56.0.dev1860__py3-none-any.whl → 0.56.0.dev1861__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.
- prediction_market_agent_tooling/tools/caches/db_cache.py +8 -10
- {prediction_market_agent_tooling-0.56.0.dev1860.dist-info → prediction_market_agent_tooling-0.56.0.dev1861.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.56.0.dev1860.dist-info → prediction_market_agent_tooling-0.56.0.dev1861.dist-info}/RECORD +6 -6
- {prediction_market_agent_tooling-0.56.0.dev1860.dist-info → prediction_market_agent_tooling-0.56.0.dev1861.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.56.0.dev1860.dist-info → prediction_market_agent_tooling-0.56.0.dev1861.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.56.0.dev1860.dist-info → prediction_market_agent_tooling-0.56.0.dev1861.dist-info}/entry_points.txt +0 -0
@@ -49,8 +49,7 @@ def db_cache(
|
|
49
49
|
api_keys: APIKeys | None = None,
|
50
50
|
ignore_args: Sequence[str] | None = None,
|
51
51
|
ignore_arg_types: Sequence[type] | None = None,
|
52
|
-
) -> Callable[[FunctionT], FunctionT]:
|
53
|
-
...
|
52
|
+
) -> Callable[[FunctionT], FunctionT]: ...
|
54
53
|
|
55
54
|
|
56
55
|
@overload
|
@@ -62,8 +61,7 @@ def db_cache(
|
|
62
61
|
api_keys: APIKeys | None = None,
|
63
62
|
ignore_args: Sequence[str] | None = None,
|
64
63
|
ignore_arg_types: Sequence[type] | None = None,
|
65
|
-
) -> FunctionT:
|
66
|
-
...
|
64
|
+
) -> FunctionT: ...
|
67
65
|
|
68
66
|
|
69
67
|
def db_cache(
|
@@ -190,7 +188,7 @@ def db_cache(
|
|
190
188
|
if is_pydantic_model:
|
191
189
|
# If the output contains any Pydantic models, we need to initialise them.
|
192
190
|
try:
|
193
|
-
return
|
191
|
+
return convert_cached_output_to_pydantic(
|
194
192
|
return_type, cached_result.result
|
195
193
|
)
|
196
194
|
except ValueError as e:
|
@@ -314,7 +312,7 @@ def convert_pydantic_to_dict(value: Any) -> Any:
|
|
314
312
|
return value
|
315
313
|
|
316
314
|
|
317
|
-
def
|
315
|
+
def convert_cached_output_to_pydantic(return_type: Any, data: Any) -> Any:
|
318
316
|
"""
|
319
317
|
Used to initialize Pydantic models from anything cached that was originally a Pydantic model in the output. Including models in nested structures.
|
320
318
|
"""
|
@@ -330,7 +328,7 @@ def convert_return_type_to_pydantic(return_type: Any, data: Any) -> Any:
|
|
330
328
|
# Convert the dictionary to a Pydantic model
|
331
329
|
return return_type(
|
332
330
|
**{
|
333
|
-
k:
|
331
|
+
k: convert_cached_output_to_pydantic(
|
334
332
|
getattr(return_type, k, None), v
|
335
333
|
)
|
336
334
|
for k, v in data.items()
|
@@ -343,9 +341,9 @@ def convert_return_type_to_pydantic(return_type: Any, data: Any) -> Any:
|
|
343
341
|
elif origin is dict:
|
344
342
|
key_type, value_type = args
|
345
343
|
return {
|
346
|
-
|
344
|
+
convert_cached_output_to_pydantic(
|
347
345
|
key_type, k
|
348
|
-
):
|
346
|
+
): convert_cached_output_to_pydantic(value_type, v)
|
349
347
|
for k, v in data.items()
|
350
348
|
}
|
351
349
|
else:
|
@@ -357,7 +355,7 @@ def convert_return_type_to_pydantic(return_type: Any, data: Any) -> Any:
|
|
357
355
|
if origin in {list, tuple}:
|
358
356
|
item_type = args[0]
|
359
357
|
converted_items = [
|
360
|
-
|
358
|
+
convert_cached_output_to_pydantic(item_type, item) for item in data
|
361
359
|
]
|
362
360
|
return type(data)(converted_items)
|
363
361
|
else:
|
@@ -69,7 +69,7 @@ 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=
|
72
|
+
prediction_market_agent_tooling/tools/caches/db_cache.py,sha256=AEU-DQ19sS3ZZJKljM9ydRoa07duFhTTzG-vadYRsJg,13851
|
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
|
@@ -97,8 +97,8 @@ prediction_market_agent_tooling/tools/tavily/tavily_models.py,sha256=5ldQs1pZe6u
|
|
97
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.
|
101
|
-
prediction_market_agent_tooling-0.56.0.
|
102
|
-
prediction_market_agent_tooling-0.56.0.
|
103
|
-
prediction_market_agent_tooling-0.56.0.
|
104
|
-
prediction_market_agent_tooling-0.56.0.
|
100
|
+
prediction_market_agent_tooling-0.56.0.dev1861.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
101
|
+
prediction_market_agent_tooling-0.56.0.dev1861.dist-info/METADATA,sha256=QYG8yvGAGGGW0yESTAYImxorjN1Js8wV3U-20MD2dw8,8114
|
102
|
+
prediction_market_agent_tooling-0.56.0.dev1861.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
103
|
+
prediction_market_agent_tooling-0.56.0.dev1861.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
104
|
+
prediction_market_agent_tooling-0.56.0.dev1861.dist-info/RECORD,,
|
File without changes
|
File without changes
|