Skip to content

Commit

Permalink
feat: add configs required for the tool selection strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Sep 20, 2023
1 parent 86969cf commit da8f225
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/valory/agents/trader/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ models:
multisend_address: ${str:0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761}
drand_public_key: ${str:868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31}
service_registry_address: ${str:null}
agent_registry_address: ${str:null}
share_tm_config_on_startup: ${bool:false}
sleep_time: ${int:10}
tendermint_p2p_url: ${str:localhost:26656}
Expand Down Expand Up @@ -187,6 +188,10 @@ models:
redeeming_batch_size: ${int:5}
slippage: ${float:0.01}
redeem_margin_days: ${int:15}
epsilon: ${float:0.1}
irrelevant_tools: ${set:{"openai-text-davinci-002", "openai-text-davinci-003", "openai-gpt-3.5-turbo",
"openai-gpt-4", "stabilityai-stable-diffusion-v1-5", "stabilityai-stable-diffusion-xl-beta-v2-2-2",
"stabilityai-stable-diffusion-512-v2-1", "stabilityai-stable-diffusion-768-v2-1"}}
---
public_id: valory/p2p_libp2p_client:0.1.0
type: connection
Expand Down
24 changes: 24 additions & 0 deletions packages/valory/services/trader/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type: skill
round_timeout_seconds: ${ROUND_TIMEOUT:float:350.0}
service_id: ${SERVICE_ID:str:trader}
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:0x9338b5153AE39BB89f50468E608eD9d764B755fD}
agent_registry_address: ${AGENT_REGISTRY_ADDRESS:str:0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA}
share_tm_config_on_startup: ${USE_ACN:bool:false}
sleep_time: ${SLEEP_TIME:int:1}
tendermint_check_sleep_delay: ${TM_CHECK_SLEEP_DELAY:int:3}
Expand Down Expand Up @@ -104,6 +105,11 @@ type: skill
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
redeem_margin_days: ${REDEEM_MARGIN_DAYS:int:15}
epsilon: ${EPSILON:float:0.1}
irrelevant_tools: ${IRRELEVANT_TOOLS:set:{"openai-text-davinci-002", "openai-text-davinci-003",
"openai-gpt-3.5-turbo", "openai-gpt-4", "stabilityai-stable-diffusion-v1-5",
"stabilityai-stable-diffusion-xl-beta-v2-2-2", "stabilityai-stable-diffusion-512-v2-1",
"stabilityai-stable-diffusion-768-v2-1"}}
benchmark_tool: &id005
args:
log_dir: ${LOG_DIR:str:/benchmarks}
Expand Down Expand Up @@ -133,6 +139,7 @@ type: skill
round_timeout_seconds: ${ROUND_TIMEOUT:float:350.0}
service_id: ${SERVICE_ID:str:trader}
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:0x9338b5153AE39BB89f50468E608eD9d764B755fD}
agent_registry_address: ${AGENT_REGISTRY_ADDRESS:str:0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA}
share_tm_config_on_startup: ${USE_ACN:bool:false}
sleep_time: ${SLEEP_TIME:int:1}
tendermint_check_sleep_delay: ${TM_CHECK_SLEEP_DELAY:int:3}
Expand Down Expand Up @@ -168,6 +175,11 @@ type: skill
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
redeem_margin_days: ${REDEEM_MARGIN_DAYS:int:15}
epsilon: ${EPSILON:float:0.1}
irrelevant_tools: ${IRRELEVANT_TOOLS:set:{"openai-text-davinci-002", "openai-text-davinci-003",
"openai-gpt-3.5-turbo", "openai-gpt-4", "stabilityai-stable-diffusion-v1-5",
"stabilityai-stable-diffusion-xl-beta-v2-2-2", "stabilityai-stable-diffusion-512-v2-1",
"stabilityai-stable-diffusion-768-v2-1"}}
benchmark_tool: *id005
2:
models:
Expand Down Expand Up @@ -195,6 +207,7 @@ type: skill
round_timeout_seconds: ${ROUND_TIMEOUT:float:350.0}
service_id: ${SERVICE_ID:str:trader}
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:0x9338b5153AE39BB89f50468E608eD9d764B755fD}
agent_registry_address: ${AGENT_REGISTRY_ADDRESS:str:0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA}
share_tm_config_on_startup: ${USE_ACN:bool:false}
sleep_time: ${SLEEP_TIME:int:1}
tendermint_check_sleep_delay: ${TM_CHECK_SLEEP_DELAY:int:3}
Expand Down Expand Up @@ -230,6 +243,11 @@ type: skill
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
redeem_margin_days: ${REDEEM_MARGIN_DAYS:int:15}
epsilon: ${EPSILON:float:0.1}
irrelevant_tools: ${IRRELEVANT_TOOLS:set:{"openai-text-davinci-002", "openai-text-davinci-003",
"openai-gpt-3.5-turbo", "openai-gpt-4", "stabilityai-stable-diffusion-v1-5",
"stabilityai-stable-diffusion-xl-beta-v2-2-2", "stabilityai-stable-diffusion-512-v2-1",
"stabilityai-stable-diffusion-768-v2-1"}}
benchmark_tool: *id005
3:
models:
Expand Down Expand Up @@ -257,6 +275,7 @@ type: skill
round_timeout_seconds: ${ROUND_TIMEOUT:float:350.0}
service_id: ${SERVICE_ID:str:trader}
service_registry_address: ${SERVICE_REGISTRY_ADDRESS:str:0x9338b5153AE39BB89f50468E608eD9d764B755fD}
agent_registry_address: ${AGENT_REGISTRY_ADDRESS:str:0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA}
share_tm_config_on_startup: ${USE_ACN:bool:false}
sleep_time: ${SLEEP_TIME:int:1}
tendermint_check_sleep_delay: ${TM_CHECK_SLEEP_DELAY:int:3}
Expand Down Expand Up @@ -292,6 +311,11 @@ type: skill
redeeming_batch_size: ${REDEEMING_BATCH_SIZE:int:1}
slippage: ${SLIPPAGE:float:0.01}
redeem_margin_days: ${REDEEM_MARGIN_DAYS:int:15}
epsilon: ${EPSILON:float:0.1}
irrelevant_tools: ${IRRELEVANT_TOOLS:set:{"openai-text-davinci-002", "openai-text-davinci-003",
"openai-gpt-3.5-turbo", "openai-gpt-4", "stabilityai-stable-diffusion-v1-5",
"stabilityai-stable-diffusion-xl-beta-v2-2-2", "stabilityai-stable-diffusion-512-v2-1",
"stabilityai-stable-diffusion-768-v2-1"}}
benchmark_tool: *id005
---
public_id: valory/ledger:0.19.0
Expand Down
11 changes: 10 additions & 1 deletion packages/valory/skills/decision_maker_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.redeeming_batch_size = self._ensure("redeeming_batch_size", kwargs, int)
# a slippage in the range of [0, 1] to apply to the `minOutcomeTokensToBuy` when buying shares on a fpmm
self._slippage = 0.0
self.slippage = self._ensure("slippage", kwargs, float)
self.slippage: float = self._ensure("slippage", kwargs, float)
self.epsilon: float = self._ensure("epsilon", kwargs, float)
self.agent_registry_address: str = self._ensure(
"agent_registry_address", kwargs, str
)
self.irrelevant_tools: set = self._ensure("irrelevant_tools", kwargs, set)
super().__init__(*args, **kwargs)

@property
Expand Down Expand Up @@ -161,6 +166,10 @@ class MechResponseSpecs(ApiSpecs):
"""A model that wraps ApiSpecs for the Mech's response specifications."""


class AgentToolsSpecs(ApiSpecs):
"""A model that wraps ApiSpecs for the Mech agent's tools specifications."""


@dataclass
class MultisendBatch:
"""A structure representing a single transaction of a multisend."""
Expand Down
23 changes: 23 additions & 0 deletions packages/valory/skills/decision_maker_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ models:
round_timeout_seconds: 350.0
service_id: decision_maker
service_registry_address: null
agent_registry_address: null
setup:
all_participants:
- '0x0000000000000000000000000000000000000000'
Expand Down Expand Up @@ -181,6 +182,16 @@ models:
realitio_address: '0x79e32aE03fb27B07C89c0c568F80287C01ca2E57'
redeeming_batch_size: 5
slippage: 0.01
epsilon: 0.1
irrelevant_tools:
? openai-text-davinci-002
? openai-text-davinci-003
? openai-gpt-3.5-turbo
? openai-gpt-4
? stabilityai-stable-diffusion-v1-5
? stabilityai-stable-diffusion-xl-beta-v2-2-2
? stabilityai-stable-diffusion-512-v2-1
? stabilityai-stable-diffusion-768-v2-1
class_name: DecisionMakerParams
mech_response:
args:
Expand All @@ -194,6 +205,18 @@ models:
retries: 5
url: ''
class_name: MechResponseSpecs
agent_tools:
args:
api_id: agent_tools
headers:
Content-Type: application/json
method: GET
parameters: { }
response_key: tools
response_type: list
retries: 5
url: ''
class_name: AgentToolsSpecs
requests:
args: {}
class_name: Requests
Expand Down
4 changes: 4 additions & 0 deletions packages/valory/skills/trader_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
from packages.valory.skills.decision_maker_abci.models import (
MechResponseSpecs as DecisionMakerMechResponseSpecs,
)
from packages.valory.skills.decision_maker_abci.models import (
AgentToolsSpecs as DecisionMakerAgentToolsSpecs,
)
from packages.valory.skills.decision_maker_abci.rounds import (
Event as DecisionMakerEvent,
)
Expand Down Expand Up @@ -68,6 +71,7 @@
OmenSubgraph = MarketManagerOmenSubgraph
NetworkSubgraph = MarketManagerNetworkSubgraph
MechResponseSpecs = DecisionMakerMechResponseSpecs
AgentToolsSpecs = DecisionMakerAgentToolsSpecs

MARGIN = 5

Expand Down
23 changes: 23 additions & 0 deletions packages/valory/skills/trader_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ models:
round_timeout_seconds: 350.0
service_id: trader
service_registry_address: null
agent_registry_address: null
setup:
all_participants:
- '0x0000000000000000000000000000000000000000'
Expand Down Expand Up @@ -169,6 +170,16 @@ models:
redeeming_batch_size: 5
slippage: 0.01
redeem_margin_days: 15
epsilon: 0.1
irrelevant_tools:
? openai-text-davinci-002
? openai-text-davinci-003
? openai-gpt-3.5-turbo
? openai-gpt-4
? stabilityai-stable-diffusion-v1-5
? stabilityai-stable-diffusion-xl-beta-v2-2-2
? stabilityai-stable-diffusion-512-v2-1
? stabilityai-stable-diffusion-768-v2-1
class_name: TraderParams
network_subgraph:
args:
Expand Down Expand Up @@ -218,6 +229,18 @@ models:
retries: 5
url: ''
class_name: MechResponseSpecs
agent_tools:
args:
api_id: agent_tools
headers:
Content-Type: application/json
method: GET
parameters: { }
response_key: tools
response_type: list
retries: 5
url: ''
class_name: AgentToolsSpecs
requests:
args: {}
class_name: Requests
Expand Down

0 comments on commit da8f225

Please sign in to comment.