diff --git a/python/examples/13-agent-name-service/agent1.py b/python/examples/13-agent-name-service/agent1.py index 5e202a41..d7d70f93 100644 --- a/python/examples/13-agent-name-service/agent1.py +++ b/python/examples/13-agent-name-service/agent1.py @@ -7,7 +7,7 @@ class Message(Model): - message: str + text: str DOMAIN = "bob.example.agent" @@ -39,7 +39,7 @@ async def register_agent_name(ctx: Context): @bob.on_message(model=Message) async def message_handler(ctx: Context, sender: str, msg: Message): - ctx.logger.info(f"Received message from {sender}: {msg.message}") + ctx.logger.info(f"Received message from {sender}: {msg.text}") if __name__ == "__main__": diff --git a/python/examples/13-agent-name-service/agent2.py b/python/examples/13-agent-name-service/agent2.py index 8adc6507..01043839 100644 --- a/python/examples/13-agent-name-service/agent2.py +++ b/python/examples/13-agent-name-service/agent2.py @@ -2,24 +2,24 @@ class Message(Model): - message: str + text: str alice = Agent( - name="alice-0", + name="alice", seed="agent alice-0 secret phrase", port=8000, endpoint=["http://localhost:8000/submit"], ) -DOMAIN = "example.agent" +DOMAIN = "bob.example.agent" @alice.on_interval(period=5) async def alice_interval_handler(ctx: Context): - bob_name = "bob-0" + "." + DOMAIN + bob_name = DOMAIN ctx.logger.info(f"Sending message to {bob_name}...") - await ctx.send(bob_name, Message(message="Hello there bob.")) + await ctx.send(bob_name, Message(text="Hello there bob.")) if __name__ == "__main__":