Skip to content
Merged
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
2 changes: 1 addition & 1 deletion examples/acp_base/cross_chain_transfer_service/buyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
logger.info(f"Job {job.id} rejection memo signed")

elif job.phase == ACPJobPhase.COMPLETED:
logger.info(f"Job {job.id} completed, received deliverable: {job.deliverable}")
logger.info(f"Job {job.id} completed, received deliverable: {job.get_deliverable()}")

elif job.phase == ACPJobPhase.REJECTED:
logger.info(f"Job {job.id} rejected by seller")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
msg = (
f"[on_new_task] Job {job_id} {job_phase}. "
+ (
f"Deliverable received: {job.deliverable}"
f"Deliverable received: {job.get_deliverable()}"
if job_phase == ACPJobPhase.COMPLETED
else f"Rejection reason: {job.rejection_reason}"
)
Expand Down
2 changes: 1 addition & 1 deletion examples/acp_base/funds_transfer/trading/buyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
msg = (
f"[on_new_task] Job {job_id} {job.phase}. "
+ (
f"Deliverable received: {job.deliverable}"
f"Deliverable received: {job.get_deliverable()}"
if job.phase == ACPJobPhase.COMPLETED
else f"Rejection reason: {job.rejection_reason}"
)
Expand Down
3 changes: 2 additions & 1 deletion examples/acp_base/funds_transfer/trading/seller.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ def handle_task_transaction(job: ACPJob):
),
Fare.from_contract_address(
to_contract,
config
config,
config.chain_id
)
)
logger.info(f"Returning swapped token: {swapped_amount}")
Expand Down
2 changes: 1 addition & 1 deletion examples/acp_base/polling_mode/buyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def buyer():
config=BASE_MAINNET_ACP_X402_CONFIG_V2, # route to x402 for payment, undefined defaulted back to direct transfer
),
)
logger.info(f"Buyer ACP Initialized. Agent: {acp_client.agent_address}")
logger.info(f"Buyer ACP Initialized. Agent: {acp_client.wallet_address}")

# Browse available agents based on a keyword and cluster name
relevant_agents = acp_client.browse_agents(
Expand Down
8 changes: 4 additions & 4 deletions examples/acp_base/polling_mode/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def evaluator():
entity_id=env.EVALUATOR_ENTITY_ID,
),
)
logger.info(f"Evaluator ACP Initialized. Agent: {acp_client.agent_address}")
logger.info(f"Evaluator ACP Initialized. Agent: {acp_client.wallet_address}")

while True:
logger.info(
f"\nPolling for jobs assigned to {acp_client.agent_address} requiring evaluation."
f"\nPolling for jobs assigned to {acp_client.wallet_address} requiring evaluation."
)
active_jobs_list: List[ACPJob] = acp_client.get_active_jobs()

Expand All @@ -54,13 +54,13 @@ def evaluator():
try:

# Ensure this job is for the current evaluator
if job.evaluator_address != acp_client.agent_address:
if job.evaluator_address != acp_client.wallet_address:
continue

if job.phase == ACPJobPhase.EVALUATION:
logger.info(f"Found Job {job.id} in EVALUATION phase.")
logger.info(
f"Job {job.id}: Evaluating deliverable: {job.deliverable} with requirement: {job.requirement}"
f"Job {job.id}: Evaluating deliverable: {job.get_deliverable()} with requirement: {job.requirement}"
)
job.evaluate(
accept=ACCEPT_EVALUATION,
Expand Down
4 changes: 2 additions & 2 deletions examples/acp_base/polling_mode/seller.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def seller():

while True:
logger.info(
f"\nPolling for active jobs for {acp_client.agent_address}."
f"\nPolling for active jobs for {acp_client.wallet_address}."
)
active_jobs_list: List[ACPJob] = acp_client.get_active_jobs()

Expand All @@ -51,7 +51,7 @@ def seller():

for job in active_jobs_list:
# Ensure this job is for the current seller
if job.provider_address != acp_client.agent_address:
if job.provider_address != acp_client.wallet_address:
continue

try:
Expand Down
2 changes: 1 addition & 1 deletion examples/acp_base/skip_evaluation/buyer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def on_new_task(job: ACPJob, memo_to_sign: Optional[ACPMemo] = None):
logger.info(f"Job {job.id} rejection memo signed")

elif job.phase == ACPJobPhase.COMPLETED:
logger.info(f"Job {job.id} completed, received deliverable: {job.deliverable}")
logger.info(f"Job {job.id} completed, received deliverable: {job.get_deliverable()}")

elif job.phase == ACPJobPhase.REJECTED:
logger.info(f"Job {job.id} rejected by seller")
Expand Down
22 changes: 20 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "virtuals-acp"
version = "0.3.20"
version = "0.3.21"
description = "Agent Commerce Protocol Python SDK by Virtuals"
authors = ["Steven Lee Soon Fatt <steven@virtuals.io>"]
readme = "README.md"
Expand All @@ -18,6 +18,7 @@ python-socketio = "^5.11.1"
websocket-client = "^1.7.0"
jsonschema = "^4.22.0"
pydantic-settings = "^2.0"
PyJWT = "^2.0.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.4"
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/test_client_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_should_filter_out_self(self, acp_client):

# Verify none of the agents are the client itself
for agent in agents:
assert agent.wallet_address.lower() != acp_client.agent_address.lower()
assert agent.wallet_address.lower() != acp_client.wallet_address.lower()

def test_should_respect_top_k_parameter(self, acp_client):
"""Should respect the top_k parameter for result limiting"""
Expand Down Expand Up @@ -92,12 +92,12 @@ class TestGetAgent:

def test_should_get_own_agent_info(self, acp_client):
"""Should successfully retrieve own agent information"""
agent = acp_client.get_agent(acp_client.agent_address)
agent = acp_client.get_agent(acp_client.wallet_address)

# Should return the agent or None
# If the agent exists
if agent:
assert agent.wallet_address.lower() == acp_client.agent_address.lower()
assert agent.wallet_address.lower() == acp_client.wallet_address.lower()
assert hasattr(agent, 'id')
assert hasattr(agent, 'job_offerings')
assert hasattr(agent, 'name')
Expand Down Expand Up @@ -161,7 +161,7 @@ def test_get_by_client_and_provider_should_handle_no_account(self, acp_client):
fake_provider = "0x0000000000000000000000000000000000000001"

account = acp_client.get_by_client_and_provider(
acp_client.agent_address,
acp_client.wallet_address,
fake_provider
)

Expand Down
Loading