Skip to content

ACP Developer Experience Improvements #34

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions examples/acp_base/helpers/acp_helper_functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from acp_sdk.client import VirtualsACP
from acp_sdk.configs import BASE_SEPOLIA_CONFIG
from acp_sdk.env import EnvSettings
from virtuals_acp.client import VirtualsACP
from virtuals_acp.configs import BASE_MAINNET_CONFIG
from virtuals_acp.env import EnvSettings

from dotenv import load_dotenv
load_dotenv(override=True)
Expand All @@ -11,8 +11,14 @@ def test_helper_functions():
acp = VirtualsACP(
wallet_private_key=env.WHITELISTED_WALLET_PRIVATE_KEY,
agent_wallet_address=env.BUYER_AGENT_WALLET_ADDRESS,
config=BASE_SEPOLIA_CONFIG
config=BASE_MAINNET_CONFIG,
Copy link
Contributor

Choose a reason for hiding this comment

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

could you remove the config param? we removed these on purpose because the default behaviour would be mainnet-only moving forward (except for exceptional scenarios)

entity_id=env.BUYER_ENTITY_ID
)

# Get agent by wallet address
agent = acp.get_agent(wallet_address=env.SELLER_AGENT_WALLET_ADDRESS)
print("\n🔵 Agent:")
print(agent)

# Get active jobs
active_jobs = acp.get_active_jobs(page=1, pageSize=10)
Expand Down
6 changes: 5 additions & 1 deletion examples/acp_base/self_evaluation/buyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import time

from virtuals_acp.client import VirtualsACP
from virtuals_acp.configs import BASE_MAINNET_CONFIG
from virtuals_acp.job import ACPJob
from virtuals_acp.models import ACPAgentSort, ACPJobPhase
from virtuals_acp.env import EnvSettings
Expand Down Expand Up @@ -47,8 +48,11 @@ def on_evaluate(job: ACPJob):
agent_wallet_address=env.BUYER_AGENT_WALLET_ADDRESS,
on_new_task=on_new_task,
on_evaluate=on_evaluate,
entity_id=env.BUYER_ENTITY_ID
entity_id=env.BUYER_ENTITY_ID,
config=BASE_MAINNET_CONFIG
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the config param

)

print(f"ACP client: {acp.agent_address}")

# Browse available agents based on a keyword and cluster name
relevant_agents = acp.browse_agents(
Expand Down
6 changes: 5 additions & 1 deletion examples/acp_base/self_evaluation/seller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json

from virtuals_acp import VirtualsACP, ACPJob, ACPJobPhase
from virtuals_acp.configs import BASE_MAINNET_CONFIG
from virtuals_acp.env import EnvSettings

from dotenv import load_dotenv
Expand Down Expand Up @@ -40,8 +41,11 @@ def on_new_task(job: ACPJob):
wallet_private_key=env.WHITELISTED_WALLET_PRIVATE_KEY,
agent_wallet_address=env.SELLER_AGENT_WALLET_ADDRESS,
on_new_task=on_new_task,
entity_id=env.SELLER_ENTITY_ID
entity_id=env.SELLER_ENTITY_ID,
config=BASE_MAINNET_CONFIG
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove the config param

)

print(f"ACP client: {acp_client.agent_address}")
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove this print statement


# Keep the script running to listen for new tasks
while True:
Expand Down
50 changes: 50 additions & 0 deletions virtuals_acp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,33 @@
)
from .exceptions import (
Copy link
Contributor

Choose a reason for hiding this comment

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

I tihnk these are a bit overkill especially if not use - would leave it to individual devs to customise their own error messages so we left it quite generic

ACPError,
ACPConnectionError,
ACPRPCConnectionError,
ACPSocketConnectionError,
ACPAuthenticationError,
ACPInvalidPrivateKeyError,
ACPInvalidAddressError,
ACPApiError,
ACPApiRequestError,
ACPAgentNotFoundError,
ACPJobNotFoundError,
ACPMemoNotFoundError,
ACPContractError,
ACPTransactionError,
ACPTransactionFailedError,
ACPInsufficientFundsError,
ACPGasEstimationError,
ACPContractLogParsingError,
ACPTransactionSigningError,
ACPJobError,
ACPJobCreationError,
ACPJobStateError,
ACPPaymentError,
ACPJobBudgetError,
ACPValidationError,
ACPMemoValidationError,
ACPSchemaValidationError,
ACPParameterValidationError,
TransactionFailedError
)
from .client import VirtualsACP
Expand All @@ -35,8 +60,33 @@
"BASE_MAINNET_CONFIG",
"DEFAULT_CONFIG",
"ACPError",
"ACPConnectionError",
"ACPRPCConnectionError",
"ACPSocketConnectionError",
"ACPAuthenticationError",
"ACPInvalidPrivateKeyError",
"ACPInvalidAddressError",
"ACPApiError",
"ACPApiRequestError",
"ACPAgentNotFoundError",
"ACPJobNotFoundError",
"ACPMemoNotFoundError",
"ACPContractError",
"ACPTransactionError",
"ACPTransactionFailedError",
"ACPInsufficientFundsError",
"ACPGasEstimationError",
"ACPContractLogParsingError",
"ACPTransactionSigningError",
"ACPJobError",
"ACPJobCreationError",
"ACPJobStateError",
"ACPPaymentError",
"ACPJobBudgetError",
"ACPValidationError",
"ACPMemoValidationError",
"ACPSchemaValidationError",
"ACPParameterValidationError",
"TransactionFailedError",
"ACP_ABI",
"ERC20_ABI",
Expand Down
Loading