-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sending messages from general agent (#581)
- Loading branch information
Showing
8 changed files
with
330 additions
and
360 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
13 changes: 13 additions & 0 deletions
13
prediction_market_agent/agents/microchain_agent/microchain_agent_keys.py
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 |
---|---|---|
@@ -1,6 +1,19 @@ | ||
from prediction_market_agent_tooling.gtypes import xDai | ||
from prediction_market_agent_tooling.loggers import logger | ||
from prediction_market_agent_tooling.markets.omen.omen import OMEN_TINY_BET_AMOUNT | ||
|
||
from prediction_market_agent.utils import APIKeys | ||
|
||
|
||
class MicrochainAgentKeys(APIKeys): | ||
# Double check to make sure you want to actually post on public social media. | ||
ENABLE_SOCIAL_MEDIA: bool = False | ||
# Double check to not spend big money during testing. | ||
SENDING_XDAI_CAP: float | None = OMEN_TINY_BET_AMOUNT | ||
|
||
def cap_sending_xdai(self, amount: xDai) -> xDai: | ||
if self.SENDING_XDAI_CAP is None: | ||
return amount | ||
amount = xDai(min(amount, self.SENDING_XDAI_CAP)) | ||
logger.warning(f"Caping sending xDai value to {amount}.") | ||
return amount |
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
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,10 @@ | ||
from prediction_market_agent.agents.microchain_agent.utils import ( | ||
compress_message, | ||
decompress_message, | ||
) | ||
|
||
|
||
def test_message_compression() -> None: | ||
message = "Hello!" | ||
encoded = compress_message(message) | ||
assert message == decompress_message(encoded) |