Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ nevermined #196

Merged
merged 13 commits into from
Jan 21, 2024
Merged

Feat/ nevermined #196

merged 13 commits into from
Jan 21, 2024

Conversation

0xArdi
Copy link
Collaborator

@0xArdi 0xArdi commented Jan 4, 2024

This PR integrates the trader with nevermined.

# Conflicts:
#	packages/packages.json
#	packages/valory/agents/trader/aea-config.yaml
#	packages/valory/services/trader/service.yaml
#	packages/valory/skills/decision_maker_abci/behaviours/round_behaviour.py
#	packages/valory/skills/decision_maker_abci/fsm_specification.yaml
#	packages/valory/skills/decision_maker_abci/rounds.py
#	packages/valory/skills/decision_maker_abci/skill.yaml
#	packages/valory/skills/trader_abci/fsm_specification.yaml
#	packages/valory/skills/trader_abci/skill.yaml
#	packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml
@property
def subscription_params(self) -> Dict[str, Any]:
"""Get the subscription params."""
return self.params.mech_to_subscription_params
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some sanity checks for the contents of these parameters when retrieving them (just in case). Their keys are being accessed unsafely below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of them as well, its better to have them as you suggest as a dataclass or something similar.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -192,6 +193,16 @@ models:
"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"]}
use_nevermined: ${bool:true}
mech_to_subscription_params: ${list:[["base_url", "https://marketplace-api.gnosis.nevermined.app/api/v1/metadata/assets/ddo"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe mech_subscription_params?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are various fixes to be made to the subscription params, I suggest we handle them in a future version

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +147 to +151
approval_params = {}
approval_params["token"] = self.payment_token
approval_params["spender"] = self.lock_payment_condition_address
approval_params["amount"] = self.price # type: ignore
return approval_params
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be inferred from the did

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidMinarsch DavidMinarsch merged commit 70f6ddf into main Jan 21, 2024
6 checks passed
@DavidMinarsch DavidMinarsch deleted the feat/add-nevermined-integration branch January 21, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants