Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
evangriffiths committed Mar 20, 2024
1 parent 124e836 commit 83dbbe2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
13 changes: 9 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import typer
from prediction_market_agent_tooling.markets.agent_market import SortBy
from prediction_market_agent_tooling.markets.markets import MARKET_TYPE_MAP, MarketType
from prediction_market_agent_tooling.tools.utils import check_not_none
from prediction_market_agent_tooling.markets.markets import (
MarketType,
get_binary_markets,
)

import prediction_market_agent as pma
from prediction_market_agent.agents.all_agents import AgentType, get_agent
Expand All @@ -18,8 +20,11 @@ def main(
Picks one market and answers it, optionally placing a bet.
"""
# Pick a market
cls = check_not_none(MARKET_TYPE_MAP.get(market_type))
market = cls.get_binary_markets(limit=1, sort_by=SortBy.NEWEST)[0]
market = get_binary_markets(
limit=1,
sort_by=SortBy.NEWEST,
market_type=market_type,
)[0]

# Create the agent and run it
agent = get_agent(agent_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
OutcomePrediction,
Prediction,
)
from prediction_market_agent_tooling.gtypes import Probability
from prediction_market_agent_tooling.markets.markets import AgentMarket
from prediction_market_agent_tooling.tools.utils import utcnow
from pydantic import BaseModel
Expand All @@ -30,7 +31,9 @@ def to_market(self) -> AgentMarket:
url=self.url if self.url else "",
id=self.question,
question=self.question,
p_yes=self.result.to_p_yes() if self.result != Result.UNKNOWN else 0.5,
p_yes=Probability(
self.result.to_p_yes() if self.result != Result.UNKNOWN else 0.5
),
volume=None,
created_time=None,
close_time=None,
Expand Down
4 changes: 0 additions & 4 deletions prediction_market_agent/agents/known_outcome_agent/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
get_current_git_commit_sha,
get_current_git_url,
)
from prediction_market_agent_tooling.tools.web3_utils import verify_address

from prediction_market_agent.agents.known_outcome_agent.known_outcome_agent import (
Result,
Expand Down Expand Up @@ -71,9 +70,6 @@ def calculate_bet_amount(self, answer: bool, market: AgentMarket) -> BetAmount:
},
memory=1024,
api_keys=APIKeys(
BET_FROM_ADDRESS=verify_address(
"0xb611A9f02B318339049264c7a66ac3401281cc3c"
),
BET_FROM_PRIVATE_KEY=private_key_type("EVAN_OMEN_BETTER_0_PKEY:latest"),
OPENAI_API_KEY=SecretStr("EVAN_OPENAI_API_KEY:latest"),
MANIFOLD_API_KEY=None,
Expand Down

0 comments on commit 83dbbe2

Please sign in to comment.