Skip to content

Commit

Permalink
add guard
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii committed Feb 16, 2024
1 parent 122de0a commit 1a15c43
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions prediction_market_agent_tooling/deploy/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import tempfile
import time
import typing as t
from decimal import Decimal

from prediction_market_agent_tooling.deploy.gcp.deploy import (
Expand All @@ -23,6 +24,18 @@


class DeployableAgent:
def __init__(self) -> None:
self.load()

def __init_subclass__(cls, **kwargs: t.Any) -> None:
if cls.__init__ is not DeployableAgent.__init__:
raise TypeError(
"Cannot override __init__ method of DeployableAgent class, please override the `load` method to set up the agent."
)

def load(self) -> None:
pass

def pick_markets(self, markets: list[AgentMarket]) -> list[AgentMarket]:
"""
This method should be implemented by the subclass to pick the markets to bet on. By default, it picks only the first market.
Expand Down

0 comments on commit 1a15c43

Please sign in to comment.