prediction-market-agent-tooling 0.13.0__py3-none-any.whl → 0.13.2__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.
@@ -55,7 +55,7 @@ class PredictionsCache(BaseModel):
55
55
 
56
56
  def save(self, path: str) -> None:
57
57
  with open(path, "w") as f:
58
- json.dump(self.dict(), f, indent=2)
58
+ json.dump(self.model_dump(), f, indent=2)
59
59
 
60
60
  @staticmethod
61
61
  def load(path: str) -> "PredictionsCache":
@@ -45,7 +45,7 @@ class AgentMarket(BaseModel):
45
45
  outcomes: list[str]
46
46
  resolution: Resolution | None
47
47
  created_time: datetime | None
48
- close_time: datetime
48
+ close_time: datetime | None
49
49
  p_yes: Probability
50
50
  url: str
51
51
  volume: Decimal | None # Should be in currency of `currency` above.
@@ -3,7 +3,6 @@ from langchain.schema.output_parser import StrOutputParser
3
3
  from langchain_openai import ChatOpenAI
4
4
 
5
5
  from prediction_market_agent_tooling.config import APIKeys
6
- from prediction_market_agent_tooling.gtypes import secretstr_to_v1_secretstr
7
6
 
8
7
 
9
8
  def infer_category(
@@ -22,7 +21,7 @@ Write only the category itself, nothing else.
22
21
  prompt
23
22
  | ChatOpenAI(
24
23
  model=model,
25
- api_key=secretstr_to_v1_secretstr(APIKeys().openai_api_key),
24
+ api_key=APIKeys().openai_api_key.get_secret_value(),
26
25
  )
27
26
  | StrOutputParser()
28
27
  )
@@ -75,6 +75,8 @@ class OmenAgentMarket(AgentMarket):
75
75
  market_maker_contract_address_checksummed: ChecksumAddress
76
76
  condition: Condition
77
77
  finalized_time: datetime | None
78
+ created_time: datetime
79
+ close_time: datetime
78
80
 
79
81
  INVALID_MARKET_ANSWER: HexStr = HexStr(
80
82
  "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
@@ -310,14 +312,18 @@ def binary_omen_buy_outcome_tx(
310
312
 
311
313
 
312
314
  def omen_sell_outcome_tx(
313
- amount: xDai,
315
+ amount: xDai, # The xDai value of shares to sell.
314
316
  from_private_key: PrivateKey,
315
317
  market: OmenAgentMarket,
316
318
  outcome: str,
317
319
  auto_withdraw: bool,
318
320
  ) -> None:
319
321
  """
320
- Sells the given amount of shares for the given outcome in the given market.
322
+ Sells the given xDai value of shares corresponding to the given outcome in
323
+ the given market.
324
+
325
+ The number of shares sold will depend on the share price at the time of the
326
+ transaction.
321
327
  """
322
328
  amount_wei = xdai_to_wei(amount)
323
329
 
@@ -42,7 +42,7 @@ def is_predictable_binary(
42
42
 
43
43
  prompt = ChatPromptTemplate.from_template(template=prompt_template)
44
44
  messages = prompt.format_messages(question=question)
45
- completion = llm(messages, max_tokens=512).content
45
+ completion = str(llm(messages, max_tokens=512).content)
46
46
 
47
47
  try:
48
48
  decision = completion.lower().rsplit("decision", 1)[1]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: prediction-market-agent-tooling
3
- Version: 0.13.0
3
+ Version: 0.13.2
4
4
  Summary: Tools to benchmark, deploy and monitor prediction market agents.
5
5
  Author: Gnosis
6
6
  Requires-Python: >=3.10,<3.12
@@ -11,7 +11,7 @@ Provides-Extra: google
11
11
  Provides-Extra: langchain
12
12
  Requires-Dist: autoflake (>=2.2.1,<3.0.0)
13
13
  Requires-Dist: cron-validator (>=1.0.8,<2.0.0)
14
- Requires-Dist: eth-typing (>=4.0.0,<5.0.0)
14
+ Requires-Dist: eth-typing (>=3.0.0,<4.0.0)
15
15
  Requires-Dist: functions-framework (>=3.5.0,<4.0.0)
16
16
  Requires-Dist: google-api-python-client (==2.95.0) ; extra == "google"
17
17
  Requires-Dist: google-cloud-functions (>=1.16.0,<2.0.0)
@@ -20,8 +20,9 @@ Requires-Dist: google-cloud-secret-manager (>=2.18.2,<3.0.0)
20
20
  Requires-Dist: isort (>=5.13.2,<6.0.0)
21
21
  Requires-Dist: langchain (>=0.1.9,<0.2.0) ; extra == "langchain"
22
22
  Requires-Dist: langchain-community (>=0.0.19)
23
- Requires-Dist: langchain-openai (>=0.0.8,<0.0.9) ; extra == "langchain"
23
+ Requires-Dist: langchain-openai (>=0.0.5,<0.0.6) ; extra == "langchain"
24
24
  Requires-Dist: loguru (>=0.7.2,<0.8.0)
25
+ Requires-Dist: mech-client (>=0.2.13,<0.3.0)
25
26
  Requires-Dist: numpy (>=1.26.4,<2.0.0)
26
27
  Requires-Dist: pydantic (>=2.6.1,<3.0.0)
27
28
  Requires-Dist: pydantic-settings (>=2.1.0,<3.0.0)
@@ -32,7 +33,7 @@ Requires-Dist: tabulate (>=0.9.0,<0.10.0)
32
33
  Requires-Dist: tqdm (>=4.66.2,<5.0.0)
33
34
  Requires-Dist: typer (>=0.9.0,<0.10.0)
34
35
  Requires-Dist: types-pytz (>=2024.1.0.20240203,<2025.0.0.0)
35
- Requires-Dist: types-requests (>=2.31.0.20240106,<3.0.0.0)
36
+ Requires-Dist: types-requests (>=2.31.0.0,<3.0.0.0)
36
37
  Requires-Dist: web3 (>=6.15.1,<7.0.0)
37
38
  Description-Content-Type: text/markdown
38
39
 
@@ -9,7 +9,7 @@ prediction_market_agent_tooling/abis/wxdai.abi.json,sha256=m3qC06Yug-pToI0lSFe1f
9
9
  prediction_market_agent_tooling/benchmark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  prediction_market_agent_tooling/benchmark/agents.py,sha256=YZidRshIxhbj7NLLKcny5ezMhv-JBvIU0uwmfaD93AU,3737
11
11
  prediction_market_agent_tooling/benchmark/benchmark.py,sha256=0lcVX65IGyrGo0WHtOwBh5NFdSEY0M2wS8CB55CcYos,21237
12
- prediction_market_agent_tooling/benchmark/utils.py,sha256=sKXSRZspMZCBoVV4kRa6Wocwmlu6OViksDG-VjFZW6Q,2748
12
+ prediction_market_agent_tooling/benchmark/utils.py,sha256=tV9eN71aFQnNU7jXsBDSbuz6VoYyvHqJL1ezyXViyHM,2754
13
13
  prediction_market_agent_tooling/config.py,sha256=eYKsOVebMYVb1JGqyIv70YEf68Xr9qIy--QzhHlXMEM,2596
14
14
  prediction_market_agent_tooling/deploy/agent.py,sha256=_67jmi2Sx0ksA-PDoOn0EGmnYRlMkrggvfo8az-hV94,7789
15
15
  prediction_market_agent_tooling/deploy/agent_example.py,sha256=vwswPCOutCG9vIqJT5lBcI1FZy3QRkNyVbNIJdn6wvk,652
@@ -17,8 +17,8 @@ prediction_market_agent_tooling/deploy/constants.py,sha256=M5ty8URipYMGe_G-RzxRy
17
17
  prediction_market_agent_tooling/deploy/gcp/deploy.py,sha256=CYUgnfy-9XVk04kkxA_5yp0GE9Mw5caYqlFUZQ2j3ks,3739
18
18
  prediction_market_agent_tooling/deploy/gcp/utils.py,sha256=x_SMhxYgNuRt8jmhlJkJAlpfX31zM6x_mvQ3Arr_3-s,5255
19
19
  prediction_market_agent_tooling/gtypes.py,sha256=ZDjXaszuTnCjnCThfJNeNJaLoxmGDSBQEcayyUfazwQ,2526
20
- prediction_market_agent_tooling/markets/agent_market.py,sha256=3Ms3N7OO2eHuSKdHZ2WZXINBB0WeolxOliZ7b-adR0A,5083
21
- prediction_market_agent_tooling/markets/categorize.py,sha256=LzmBkpLQech19yCxmsyKSJ-6trzAo6lXUmOuqgVZbco,1026
20
+ prediction_market_agent_tooling/markets/agent_market.py,sha256=sL8ASQ1bDvvIjy1ZBUMcqA6Qm44VF0GMKcUCX_wxIyI,5090
21
+ prediction_market_agent_tooling/markets/categorize.py,sha256=yTd-lDMPW4ESDSzmxeLLBuzLX0FggOF7Vbswh7295o0,941
22
22
  prediction_market_agent_tooling/markets/data_models.py,sha256=gijy3i1xSvDtM-BK0XbqZCSNqEjpysD1KJis7BngX5k,793
23
23
  prediction_market_agent_tooling/markets/manifold/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  prediction_market_agent_tooling/markets/manifold/api.py,sha256=dv-uUqt_yRLrQAymGEaTXX6C37NePo8ZPwK1l4CwLWk,6882
@@ -28,7 +28,7 @@ prediction_market_agent_tooling/markets/manifold/utils.py,sha256=cPPFWXm3vCYH1jy
28
28
  prediction_market_agent_tooling/markets/markets.py,sha256=pIYIlTAvXGrGh1XxNlHJQPEGi36_DHQ-WN2m0TCjEn0,1575
29
29
  prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  prediction_market_agent_tooling/markets/omen/data_models.py,sha256=LrpuO1e8D6EzftPLd15bmEQ9U8Q2IK2PLVfACFq6S_I,12214
31
- prediction_market_agent_tooling/markets/omen/omen.py,sha256=4hPNfUTks6CkTfKgpg9JblQolBxhhaabWPGq_czWeQw,26041
31
+ prediction_market_agent_tooling/markets/omen/omen.py,sha256=ME7aWvaSEK-sUcKJ_8wQZNs2QV6fx3871FX5ow-R1Yw,26249
32
32
  prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=OFKRpt59iVGvBCUScj0iGJJuqQwkjRefxhM58tOy57E,19354
33
33
  prediction_market_agent_tooling/markets/omen/omen_replicate.py,sha256=VOvatdK_9OMrYhF1f_7DL8c-kcUDuzUWa5VbKpR6LfQ,7427
34
34
  prediction_market_agent_tooling/markets/omen/omen_resolve_replicated.py,sha256=5Aqpl99TIXPbV7oL7qyrxPZd2hdl7rz1yhqSGKioUB4,11187
@@ -54,13 +54,13 @@ prediction_market_agent_tooling/tools/contract.py,sha256=Onm4vy3Tt8uH7w8CweDu6CD
54
54
  prediction_market_agent_tooling/tools/gnosis_rpc.py,sha256=9L3X5jBQcTZDQK4cHm5vzU7SOnjb0ERA6IWQ9C_bKUw,660
55
55
  prediction_market_agent_tooling/tools/google.py,sha256=P-ifiMk7bxQdU1ceON9apcZlw4rLHeOcYwxdeE4Of6Q,1761
56
56
  prediction_market_agent_tooling/tools/hexbytes_custom.py,sha256=2s_eMa0KwA_a9gLmcI4oXKHL3NwoDIACTSpceomeV7g,2037
57
- prediction_market_agent_tooling/tools/is_predictable.py,sha256=QEH2VEG-RsypXtxo4mPT37qtDVW5N4a8fwAFZGA65EI,2613
57
+ prediction_market_agent_tooling/tools/is_predictable.py,sha256=MkElDkQRd2K3ZoAbqwk9WZluhqGDgx4vdt5cq_DoAz8,2618
58
58
  prediction_market_agent_tooling/tools/parallelism.py,sha256=_PCiD5apyO_jyXcmBDOOVwE7bQFZnhuA_MIjUwCYIjM,733
59
59
  prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0rnVhtQGzwoUdAgn_7u_GBM,729
60
60
  prediction_market_agent_tooling/tools/utils.py,sha256=6MRfLr5xGPEQGobLz_eCsE_p-XaAeOCcmygwgNCIvqE,5044
61
61
  prediction_market_agent_tooling/tools/web3_utils.py,sha256=-ti5hPuyTmtgAHTpCJsP0zaxZEGa7H7zSMH_RtiSB8A,5314
62
- prediction_market_agent_tooling-0.13.0.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
63
- prediction_market_agent_tooling-0.13.0.dist-info/METADATA,sha256=r1vhW7v0N27cFuPOKsmGoHu_MRIBSblvFLp95LCwwQ4,4661
64
- prediction_market_agent_tooling-0.13.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
- prediction_market_agent_tooling-0.13.0.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
66
- prediction_market_agent_tooling-0.13.0.dist-info/RECORD,,
62
+ prediction_market_agent_tooling-0.13.2.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
63
+ prediction_market_agent_tooling-0.13.2.dist-info/METADATA,sha256=Bmz1CcYHahP5ZNqzKP3aHjLK5bLk9gWY_nSsaHXfq2k,4699
64
+ prediction_market_agent_tooling-0.13.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
65
+ prediction_market_agent_tooling-0.13.2.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
66
+ prediction_market_agent_tooling-0.13.2.dist-info/RECORD,,