-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
614f4b3
commit db0013c
Showing
3 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import random | ||
|
||
from prediction_market_agent.data_models.market_data_models import AgentMarket | ||
from prediction_market_agent.deploy.deploy import DeployableAgent, DeploymentType | ||
from prediction_market_agent.markets.all_markets import MarketType | ||
from prediction_market_agent.utils import get_keys | ||
|
||
|
||
def test_local_deployment(): | ||
class DeployableCoinFlipAgent(DeployableAgent): | ||
def pick_markets(self, markets: list[AgentMarket]) -> list[AgentMarket]: | ||
if len(markets) > 1: | ||
return random.sample(markets, 1) | ||
return markets | ||
|
||
def answer_binary_market(self, market: AgentMarket) -> bool: | ||
return random.choice([True, False]) | ||
|
||
agent = DeployableCoinFlipAgent() | ||
agent.deploy( | ||
sleep_time=0.001, | ||
market_type=MarketType.MANIFOLD, | ||
deployment_type=DeploymentType.LOCAL, | ||
api_keys=get_keys(), | ||
timeout=0.01, | ||
place_bet=False, | ||
) |