diff --git a/python/examples/10-cleaning-demo/protocols/cleaning/__init__.py b/python/examples/10-cleaning-demo/protocols/cleaning/__init__.py index c13dc5e3..597a2629 100644 --- a/python/examples/10-cleaning-demo/protocols/cleaning/__init__.py +++ b/python/examples/10-cleaning-demo/protocols/cleaning/__init__.py @@ -65,7 +65,7 @@ def in_service_region( @cleaning_proto.on_message(model=ServiceRequest, replies=ServiceResponse) async def handle_query_request(ctx: Context, sender: str, msg: ServiceRequest): - provider = await Provider.filter(name=ctx.name).first() + provider = await Provider.filter(name=ctx.agent.name).first() availability = await Availability.get(provider=provider) services = [int(service.type) for service in await provider.services] markup = provider.markup @@ -94,7 +94,7 @@ async def handle_query_request(ctx: Context, sender: str, msg: ServiceRequest): @cleaning_proto.on_message(model=ServiceBooking, replies=BookingResponse) async def handle_book_request(ctx: Context, sender: str, msg: ServiceBooking): - provider = await Provider.filter(name=ctx.name).first() + provider = await Provider.filter(name=ctx.agent.name).first() availability = await Availability.get(provider=provider) services = [int(service.type) for service in await provider.services] diff --git a/python/examples/13-agent-name-service/agent1.py b/python/examples/13-agent-name-service/agent1.py index ceb6cc09..25834248 100644 --- a/python/examples/13-agent-name-service/agent1.py +++ b/python/examples/13-agent-name-service/agent1.py @@ -1,6 +1,6 @@ from cosmpy.aerial.wallet import LocalWallet from uagents import Agent, Context, Model -from uagents.network import get_faucet, get_name_service_contract +from uagents.network import get_faucet, get_name_service_contract, logger # NOTE: Run agent1.py before running agent2.py @@ -22,10 +22,12 @@ class Message(Model): faucet = get_faucet() DOMAIN = "example.agent" +logger.info(f"Adding testnet funds to {my_wallet.address()}...") faucet.get_wealth(my_wallet.address()) +logger.info(f"Adding testnet funds to {my_wallet.address()}...complete") -@bob.on_event("startup") +@bob.on_interval(10) async def register_agent_name(ctx: Context): await name_service_contract.register( bob.ledger, my_wallet, bob.address, bob.name, DOMAIN diff --git a/python/pyproject.toml b/python/pyproject.toml index 520fd5cd..96c6ab92 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "uagents" -version = "0.14.0" +version = "0.15.0" description = "Lightweight framework for rapid agent-based development" authors = [ "Ed FitzGerald ",