prediction-market-agent-tooling 0.29.0__py3-none-any.whl → 0.31.0__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/loggers.py +11 -2
- prediction_market_agent_tooling/markets/agent_market.py +5 -0
- prediction_market_agent_tooling/markets/manifold/manifold.py +5 -0
- prediction_market_agent_tooling/markets/omen/omen.py +4 -0
- prediction_market_agent_tooling/tools/is_predictable.py +6 -1
- {prediction_market_agent_tooling-0.29.0.dist-info → prediction_market_agent_tooling-0.31.0.dist-info}/METADATA +1 -1
- {prediction_market_agent_tooling-0.29.0.dist-info → prediction_market_agent_tooling-0.31.0.dist-info}/RECORD +10 -10
- {prediction_market_agent_tooling-0.29.0.dist-info → prediction_market_agent_tooling-0.31.0.dist-info}/LICENSE +0 -0
- {prediction_market_agent_tooling-0.29.0.dist-info → prediction_market_agent_tooling-0.31.0.dist-info}/WHEEL +0 -0
- {prediction_market_agent_tooling-0.29.0.dist-info → prediction_market_agent_tooling-0.31.0.dist-info}/entry_points.txt +0 -0
@@ -14,12 +14,21 @@ class LogFormat(str, Enum):
|
|
14
14
|
GCP = "gcp"
|
15
15
|
|
16
16
|
|
17
|
+
class LogLevel(str, Enum):
|
18
|
+
CRITICAL = "CRITICAL"
|
19
|
+
ERROR = "ERROR"
|
20
|
+
WARNING = "WARNING"
|
21
|
+
INFO = "INFO"
|
22
|
+
DEBUG = "DEBUG"
|
23
|
+
|
24
|
+
|
17
25
|
class LogConfig(BaseSettings):
|
18
26
|
model_config = SettingsConfigDict(
|
19
27
|
env_file=".env", env_file_encoding="utf-8", extra="ignore"
|
20
28
|
)
|
21
29
|
|
22
30
|
LOG_FORMAT: LogFormat = LogFormat.DEFAULT
|
31
|
+
LOG_LEVEL: LogLevel = LogLevel.DEBUG
|
23
32
|
|
24
33
|
|
25
34
|
GCP_LOG_LOGURU_FORMAT = (
|
@@ -49,7 +58,7 @@ def patch_logger() -> None:
|
|
49
58
|
# Change built-in logging.
|
50
59
|
if format_logging is not None:
|
51
60
|
logging.basicConfig(
|
52
|
-
level=
|
61
|
+
level=config.LOG_LEVEL.value, format=format_logging, datefmt=datefmt_logging
|
53
62
|
)
|
54
63
|
|
55
64
|
# Change loguru.
|
@@ -58,7 +67,7 @@ def patch_logger() -> None:
|
|
58
67
|
logger.add(
|
59
68
|
sys.stdout,
|
60
69
|
format=format_loguru,
|
61
|
-
level=
|
70
|
+
level=config.LOG_LEVEL.value,
|
62
71
|
colorize=True,
|
63
72
|
)
|
64
73
|
|
@@ -5,6 +5,7 @@ from enum import Enum
|
|
5
5
|
from eth_typing import ChecksumAddress
|
6
6
|
from pydantic import BaseModel, field_validator
|
7
7
|
|
8
|
+
from prediction_market_agent_tooling.config import APIKeys
|
8
9
|
from prediction_market_agent_tooling.gtypes import Probability
|
9
10
|
from prediction_market_agent_tooling.markets.data_models import (
|
10
11
|
Bet,
|
@@ -196,3 +197,7 @@ class AgentMarket(BaseModel):
|
|
196
197
|
if self.is_closed() or not self.has_liquidity():
|
197
198
|
return False
|
198
199
|
return True
|
200
|
+
|
201
|
+
@classmethod
|
202
|
+
def get_user_url(cls, keys: APIKeys) -> str:
|
203
|
+
raise NotImplementedError("Subclasses must implement this method")
|
@@ -11,6 +11,7 @@ from prediction_market_agent_tooling.markets.agent_market import (
|
|
11
11
|
)
|
12
12
|
from prediction_market_agent_tooling.markets.data_models import BetAmount, Currency
|
13
13
|
from prediction_market_agent_tooling.markets.manifold.api import (
|
14
|
+
get_authenticated_user,
|
14
15
|
get_manifold_binary_markets,
|
15
16
|
place_bet,
|
16
17
|
)
|
@@ -108,3 +109,7 @@ class ManifoldAgentMarket(AgentMarket):
|
|
108
109
|
excluded_questions=excluded_questions,
|
109
110
|
)
|
110
111
|
]
|
112
|
+
|
113
|
+
@classmethod
|
114
|
+
def get_user_url(cls, keys: APIKeys) -> str:
|
115
|
+
return get_authenticated_user(keys.manifold_api_key.get_secret_value()).url
|
@@ -369,6 +369,10 @@ class OmenAgentMarket(AgentMarket):
|
|
369
369
|
|
370
370
|
return positions
|
371
371
|
|
372
|
+
@classmethod
|
373
|
+
def get_user_url(cls, keys: APIKeys) -> str:
|
374
|
+
return f"https://gnosisscan.io/address/{keys.bet_from_address}"
|
375
|
+
|
372
376
|
|
373
377
|
def pick_binary_market(
|
374
378
|
sort_by: SortBy = SortBy.CLOSING_SOONEST, filter_by: FilterBy = FilterBy.OPEN
|
@@ -1,5 +1,6 @@
|
|
1
1
|
from loguru import logger
|
2
2
|
|
3
|
+
from prediction_market_agent_tooling.config import APIKeys
|
3
4
|
from prediction_market_agent_tooling.tools.cache import persistent_inmemory_cache
|
4
5
|
|
5
6
|
# I tried to make it return a JSON, but it didn't work well in combo with asking it to do chain of thought.
|
@@ -44,7 +45,11 @@ def is_predictable_binary(
|
|
44
45
|
logger.info("langchain not installed, skipping is_predictable_binary")
|
45
46
|
return True
|
46
47
|
|
47
|
-
llm = ChatOpenAI(
|
48
|
+
llm = ChatOpenAI(
|
49
|
+
model=engine,
|
50
|
+
temperature=0.0,
|
51
|
+
api_key=APIKeys().openai_api_key.get_secret_value(),
|
52
|
+
)
|
48
53
|
|
49
54
|
prompt = ChatPromptTemplate.from_template(template=prompt_template)
|
50
55
|
messages = prompt.format_messages(question=question)
|
@@ -19,19 +19,19 @@ prediction_market_agent_tooling/deploy/gcp/deploy.py,sha256=CYUgnfy-9XVk04kkxA_5
|
|
19
19
|
prediction_market_agent_tooling/deploy/gcp/kubernetes_models.py,sha256=qYIHRxQLac3yxtZ8ChikiPG9O1aUQucHW0muTSm1nto,2627
|
20
20
|
prediction_market_agent_tooling/deploy/gcp/utils.py,sha256=oyW0jgrUT2Tr49c7GlpcMsYNQjoCSOcWis3q-MmVAhU,6089
|
21
21
|
prediction_market_agent_tooling/gtypes.py,sha256=xGSJXw12hzp8LwvQ956l01GiZMWd07MZTYqo8CXVeLY,2417
|
22
|
-
prediction_market_agent_tooling/loggers.py,sha256=
|
23
|
-
prediction_market_agent_tooling/markets/agent_market.py,sha256=
|
22
|
+
prediction_market_agent_tooling/loggers.py,sha256=ua9rynYmsbOJZjxPIFxRBooomeN08zuLSJ7lxZMDS7w,3133
|
23
|
+
prediction_market_agent_tooling/markets/agent_market.py,sha256=SMvkXct_RgHXqF-fVq3ooTIQ_99MG77kVlvS3rM8Ozo,7019
|
24
24
|
prediction_market_agent_tooling/markets/categorize.py,sha256=yTd-lDMPW4ESDSzmxeLLBuzLX0FggOF7Vbswh7295o0,941
|
25
25
|
prediction_market_agent_tooling/markets/data_models.py,sha256=uODY3aoFp8YYeLAUcrzMk1yU8pIKsTLobB9xIEGTmKs,1170
|
26
26
|
prediction_market_agent_tooling/markets/manifold/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
prediction_market_agent_tooling/markets/manifold/api.py,sha256=m6qOzDiyQfxj62Eo_SzzQLkX4ijpi8KtQKGd4CpKAsk,7307
|
28
28
|
prediction_market_agent_tooling/markets/manifold/data_models.py,sha256=2DZIxwtDp-PH0UWTGiktMFIGAAQoVutI07UsxjNyTyE,5296
|
29
|
-
prediction_market_agent_tooling/markets/manifold/manifold.py,sha256=
|
29
|
+
prediction_market_agent_tooling/markets/manifold/manifold.py,sha256=EwRL06E2Y_ZAzr8efwS5yD6p6rnykrcBhqmNDUGZ8Aw,4075
|
30
30
|
prediction_market_agent_tooling/markets/manifold/utils.py,sha256=cPPFWXm3vCYH1jy7_ctJZuQH9ZDaPL4_AgAYzGWkoow,513
|
31
31
|
prediction_market_agent_tooling/markets/markets.py,sha256=w05Oo7yCA2axpCw69Q9y4i9Gcdpht0u5bZGbWqld3rU,2964
|
32
32
|
prediction_market_agent_tooling/markets/omen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
prediction_market_agent_tooling/markets/omen/data_models.py,sha256=EXtjmcujx68Xu50BVkYXvLuf_Asx5o65RvFS3ZS6HGs,14405
|
34
|
-
prediction_market_agent_tooling/markets/omen/omen.py,sha256=
|
34
|
+
prediction_market_agent_tooling/markets/omen/omen.py,sha256=wQIdECDREiRnUROlp1BF1W25so_Gs-9YXKjjj0kksAs,32041
|
35
35
|
prediction_market_agent_tooling/markets/omen/omen_contracts.py,sha256=eDS8vN4Klv_-Y1wwfIeLDt3twhl9U_AJjPQov0JScb0,19888
|
36
36
|
prediction_market_agent_tooling/markets/omen/omen_resolving.py,sha256=g77QsQ5WnSI2rzBlX87L_EhWMwobkyXyfRhHQmpAdzo,9012
|
37
37
|
prediction_market_agent_tooling/markets/omen/omen_subgraph_handler.py,sha256=QZWwkqvOqQ-b15jidwTNsn1K64x3FY_Un-l6A6g3Twg,22299
|
@@ -59,14 +59,14 @@ prediction_market_agent_tooling/tools/costs.py,sha256=EaAJ7v9laD4VEV3d8B44M4u3_o
|
|
59
59
|
prediction_market_agent_tooling/tools/gnosis_rpc.py,sha256=_MYSoyOR2MgAJkop1ERf8RhLum-M8S6OjaAsaqUW41w,203
|
60
60
|
prediction_market_agent_tooling/tools/google.py,sha256=SfVDxb3oEOUK8mpd0l3mTX9ybrdrTPNM6HjfJ7kfNjA,1794
|
61
61
|
prediction_market_agent_tooling/tools/hexbytes_custom.py,sha256=Bp94qgPjvjWf1Vb4lNzGFDXRdThw1rJ91vL6r2PWq5E,2096
|
62
|
-
prediction_market_agent_tooling/tools/is_predictable.py,sha256=
|
62
|
+
prediction_market_agent_tooling/tools/is_predictable.py,sha256=yRSkmu4lZqrSje9QGpnyWTFmdCnRvClfaFDHE2Zf9G4,2936
|
63
63
|
prediction_market_agent_tooling/tools/parallelism.py,sha256=8mgkF5sBwFGS5GMvlpzam82Y3p2swPYuNsywpQuy-a4,1508
|
64
64
|
prediction_market_agent_tooling/tools/safe.py,sha256=h0xOO0eNtitClf0fPkn-0oTc6A_bflDTee98V_aiV-A,5195
|
65
65
|
prediction_market_agent_tooling/tools/singleton.py,sha256=CiIELUiI-OeS7U7eeHEt0rnVhtQGzwoUdAgn_7u_GBM,729
|
66
66
|
prediction_market_agent_tooling/tools/utils.py,sha256=zkmwPi3YisgZDPCeNwaRbL8sInOYOkvFgFY4Q8PbEo4,5077
|
67
67
|
prediction_market_agent_tooling/tools/web3_utils.py,sha256=cboATXNmEdn5RmPbVblHOwOdUMKBYrUK3GiI6i6Vzxo,9855
|
68
|
-
prediction_market_agent_tooling-0.
|
69
|
-
prediction_market_agent_tooling-0.
|
70
|
-
prediction_market_agent_tooling-0.
|
71
|
-
prediction_market_agent_tooling-0.
|
72
|
-
prediction_market_agent_tooling-0.
|
68
|
+
prediction_market_agent_tooling-0.31.0.dist-info/LICENSE,sha256=6or154nLLU6bELzjh0mCreFjt0m2v72zLi3yHE0QbeE,7650
|
69
|
+
prediction_market_agent_tooling-0.31.0.dist-info/METADATA,sha256=LKQcmOFaHJoGx4mocx4Gh04ErtMk-D-F9sRRJBNvE5s,5465
|
70
|
+
prediction_market_agent_tooling-0.31.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
71
|
+
prediction_market_agent_tooling-0.31.0.dist-info/entry_points.txt,sha256=m8PukHbeH5g0IAAmOf_1Ahm-sGAMdhSSRQmwtpmi2s8,81
|
72
|
+
prediction_market_agent_tooling-0.31.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|