Skip to content

Commit

Permalink
Bump to 0.24.0 PMAT (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored May 7, 2024
1 parent 2c83bb7 commit dd79d47
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 75 deletions.
119 changes: 60 additions & 59 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions prediction_market_agent/agents/coinflip_agent/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

from prediction_market_agent_tooling.deploy.agent import (
Answer,
DeployableAgent,
DeployableTraderAgent,
Probability,
)
from prediction_market_agent_tooling.markets.agent_market import AgentMarket


class DeployableCoinFlipAgent(DeployableAgent):
class DeployableCoinFlipAgent(DeployableTraderAgent):
def pick_markets(self, markets: t.Sequence[AgentMarket]) -> t.Sequence[AgentMarket]:
return random.sample(markets, 1)

Expand Down
4 changes: 2 additions & 2 deletions prediction_market_agent/agents/known_outcome_agent/deploy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random
import typing as t

from prediction_market_agent_tooling.deploy.agent import Answer, DeployableAgent
from prediction_market_agent_tooling.deploy.agent import Answer, DeployableTraderAgent
from prediction_market_agent_tooling.loggers import logger
from prediction_market_agent_tooling.markets.agent_market import AgentMarket
from prediction_market_agent_tooling.markets.data_models import BetAmount
Expand All @@ -15,7 +15,7 @@
from prediction_market_agent.agents.utils import market_is_saturated


class DeployableKnownOutcomeAgent(DeployableAgent):
class DeployableKnownOutcomeAgent(DeployableTraderAgent):
model = "gpt-4-1106-preview"
min_liquidity = 5

Expand Down
4 changes: 2 additions & 2 deletions prediction_market_agent/agents/mech_agent/deploy.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing as t

from prediction_market_agent_tooling.benchmark.utils import OutcomePrediction
from prediction_market_agent_tooling.deploy.agent import DeployableAgent
from prediction_market_agent_tooling.deploy.agent import DeployableTraderAgent
from prediction_market_agent_tooling.markets.agent_market import AgentMarket

from prediction_market_agent.tools.mech.utils import (
Expand All @@ -12,7 +12,7 @@
)


class DeployableMechAgentBase(DeployableAgent):
class DeployableMechAgentBase(DeployableTraderAgent):
bet_on_n_markets_per_run: int = 5

def load(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion prediction_market_agent/agents/microchain_agent/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DeployableMicrochainAgent(DeployableAgent):
model = "gpt-4-1106-preview"
n_iterations = 50

def run(self, market_type: MarketType, _place_bet: bool = True) -> None:
def run(self, market_type: MarketType) -> None:
"""
Override main 'run' method, as the all logic from the helper methods
is handed over to the agent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class ReplicateSettings(BaseSettings):


class DeployableReplicateToOmenAgent(DeployableAgent):
def run(
self, market_type: MarketType = MarketType.MANIFOLD, _place_bet: bool = True
) -> None:
def run(self, market_type: MarketType = MarketType.MANIFOLD) -> None:
if market_type != MarketType.OMEN:
raise RuntimeError("Can replicate only into Omen.")

Expand Down
10 changes: 6 additions & 4 deletions prediction_market_agent/agents/think_thoroughly_agent/deploy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from prediction_market_agent_tooling.deploy.agent import Answer, DeployableAgent
from prediction_market_agent_tooling.deploy.agent import Answer, DeployableTraderAgent
from prediction_market_agent_tooling.markets.agent_market import AgentMarket
from prediction_market_agent_tooling.markets.markets import MarketType

Expand All @@ -7,7 +7,7 @@
)


class DeployableThinkThoroughlyAgent(DeployableAgent):
class DeployableThinkThoroughlyAgent(DeployableTraderAgent):
model: str = "gpt-4-turbo-2024-04-09"
bet_on_n_markets_per_run = 1

Expand All @@ -19,7 +19,9 @@ def answer_binary_market(self, market: AgentMarket) -> Answer | None:


if __name__ == "__main__":
agent = DeployableThinkThoroughlyAgent()
agent = DeployableThinkThoroughlyAgent(place_bet=False)
agent.deploy_local(
market_type=MarketType.OMEN, sleep_time=540, timeout=180, place_bet=False
market_type=MarketType.OMEN,
sleep_time=540,
timeout=180,
)
2 changes: 1 addition & 1 deletion prediction_market_agent/run_agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Entrypoint for running the agent in GKE.
If the agent adheres to PMAT standard (subclasses DeployableAgent),
If the agent adheres to PMAT standard (subclasses deployable agent),
simply add the agent to the `RunnableAgent` enum and then `RUNNABLE_AGENTS` dict.
Can also be executed locally, simply by running `python prediction_market_agent/run_agent.py <agent> <market_type>`.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ poetry = "^1.7.1"
poetry-plugin-export = "^1.6.0"
functions-framework = "^3.5.0"
cron-validator = "^1.0.8"
prediction-market-agent-tooling = { version = "^0.23.0", extras = ["langchain", "google", "mech-client"] }
prediction-market-agent-tooling = { version = "^0.24.0", extras = ["langchain", "google", "mech-client"] }
pydantic-settings = "^2.1.0"
autoflake = "^2.2.1"
isort = "^5.13.2"
Expand Down

0 comments on commit dd79d47

Please sign in to comment.