Skip to content

Commit

Permalink
release: v0.3.1 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrriehl authored Feb 28, 2023
1 parent 7068cfc commit 95c10b6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions examples/11-mailbox-agents/agent1.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
from uagents import Agent, Context, Model
from uagents.setup import fund_agent_if_low, register_agent_with_mailbox
from uagents.setup import fund_agent_if_low


class Message(Model):
message: str


BOB_ADDRESS = "agent1q2kxet3vh0scsf0sm7y2erzz33cve6tv5uk63x64upw5g68kr0chkv7hw50"
BOB_ADDRESS = "agent1qwdxsdmxus9v7ama8y95krj048286euu0vsaxq6qgzjec00xlfyevfmf3cu"

API_KEY = "my_api_key"
MAILBOX_URL = "ws://127.0.0.1:8000"


agent = Agent(
name="alice",
seed="alice secret phrase",
mailbox="my_api_key@ws://127.0.0.1:8000",
seed="alice new phrase",
mailbox=f"{API_KEY}@{MAILBOX_URL}",
)

fund_agent_if_low(agent.wallet.address())
register_agent_with_mailbox(agent, "alice@uagent.ai")


@agent.on_interval(period=2.0)
Expand Down
11 changes: 7 additions & 4 deletions examples/11-mailbox-agents/agent2.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
from uagents import Agent, Context, Model
from uagents.setup import fund_agent_if_low, register_agent_with_mailbox
from uagents.setup import fund_agent_if_low


class Message(Model):
message: str


API_KEY = "my_api_key"
MAILBOX_URL = "ws://127.0.0.1:8000"


agent = Agent(
name="bob",
seed="bob secret phrase",
mailbox="my_api_key@ws://127.0.0.1:8000",
seed="bob new phrase",
mailbox=f"{API_KEY}@{MAILBOX_URL}",
)

fund_agent_if_low(agent.wallet.address())
register_agent_with_mailbox(agent, "bob@uagent.ai")


@agent.on_message(model=Message, replies={Message})
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "uagents"
version = "0.3.0"
version = "0.3.1"
description = "Lightweight framework for rapid agent-based development"
authors = ["Ed FitzGerald <edward.fitzgerald@fetch.ai>", "James Riehl <james.riehl@fetch.ai>", "Alejandro Morales <alejandro.madrigal@fetch.ai>"]
license = "Apache 2.0"
Expand Down

0 comments on commit 95c10b6

Please sign in to comment.