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(core): updates to mailbox and agentverse registration process #588

Merged
merged 18 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 2 additions & 8 deletions python/examples/11-mailbox-agents/alice.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ class Message(Model):
# First generate a secure seed phrase (e.g. https://pypi.org/project/mnemonic/)
SEED_PHRASE = "put_your_seed_phrase_here"

# Copy the address shown below
print(f"Your agent's address is: {Agent(seed=SEED_PHRASE).address}")

# Then go to https://agentverse.ai, register your agent in the Mailroom
# and copy the agent's mailbox key
AGENT_MAILBOX_KEY = "put_your_AGENT_MAILBOX_KEY_here"

# Now your agent is ready to join the agentverse!
agent = Agent(
name="alice",
seed=SEED_PHRASE,
mailbox=f"{AGENT_MAILBOX_KEY}@https://agentverse.ai",
port=8000,
endpoint="http://agentverse.ai/v1/submit",
)


Expand Down
10 changes: 2 additions & 8 deletions python/examples/11-mailbox-agents/bob.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,12 @@ class Message(Model):
# Generate a second seed phrase (e.g. https://pypi.org/project/mnemonic/)
SEED_PHRASE = "put_your_seed_phrase_here"

# Copy the address shown below
print(f"Your agent's address is: {Agent(seed=SEED_PHRASE).address}")

# Then go to https://agentverse.ai, register your agent in the Mailroom
# and copy the agent's mailbox key
AGENT_MAILBOX_KEY = "put_your_AGENT_MAILBOX_KEY_here"

# Now your agent is ready to join the agentverse!
agent = Agent(
name="bob",
seed=SEED_PHRASE,
mailbox=f"{AGENT_MAILBOX_KEY}@https://agentverse.ai",
port=8001,
endpoint="http://agentverse.ai/v1/submit",
)


Expand Down
1 change: 0 additions & 1 deletion python/examples/12-remote-agents/agent1.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ async def act_on_message(ctx: Context, sender: str, msg: Message):
ctx.logger.info(f"Received message from {sender[-8:]}: {msg.message}")


print(f"Agent address: {alice.address}")
print(f"Agent public URL: {http_tunnel.public_url}/submit")

if __name__ == "__main__":
Expand Down
1 change: 0 additions & 1 deletion python/examples/17-stateful-communication/agent1.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,4 @@ async def conclude_chitchat(


if __name__ == "__main__":
print(f"Agent address: {agent.address}")
agent.run()
1 change: 0 additions & 1 deletion python/examples/17-stateful-communication/agent2.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@ async def start_cycle(ctx: Context):


if __name__ == "__main__":
print(f"Agent address: {agent.address}")
agent.run()
1 change: 0 additions & 1 deletion python/examples/17-stateful-communication/agent3.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@ async def continue_chitchat(


if __name__ == "__main__":
print(f"Agent address: {agent.address}")
agent.run()
1 change: 0 additions & 1 deletion python/examples/17-stateful-communication/agent4.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ async def start_cycle(ctx: Context):
agent.include(chitchat_dialogue)

if __name__ == "__main__":
print(f"Agent address: {agent.address}")
agent.run()
1 change: 1 addition & 0 deletions python/src/uagents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,7 @@ async def _startup(self):
Perform startup actions.

"""
self._logger.info(f"Starting agent with address: {self.address}")
if self._registration_policy:
if self._endpoints:
self.start_registration_loop()
Expand Down
Loading