agentstr 0.1.10__py3-none-any.whl → 0.1.12__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- agentstr/__init__.py +20 -13
- agentstr/buyer.py +291 -0
- agentstr/buyer.pyi +31 -0
- agentstr/{marketplace.py → merchant.py} +126 -323
- agentstr/merchant.pyi +37 -0
- agentstr/models.py +381 -0
- agentstr/models.pyi +103 -0
- agentstr/nostr.py +389 -53
- agentstr/nostr.pyi +82 -0
- agentstr/py.typed +0 -0
- agentstr-0.1.12.dist-info/METADATA +129 -0
- agentstr-0.1.12.dist-info/RECORD +15 -0
- agentstr/examples/basic_cli/.env.example +0 -2
- agentstr/examples/basic_cli/README.md +0 -11
- agentstr/examples/basic_cli/main.py +0 -193
- agentstr-0.1.10.dist-info/METADATA +0 -133
- agentstr-0.1.10.dist-info/RECORD +0 -11
- {agentstr-0.1.10.dist-info → agentstr-0.1.12.dist-info}/LICENSE +0 -0
- {agentstr-0.1.10.dist-info → agentstr-0.1.12.dist-info}/WHEEL +0 -0
- {agentstr-0.1.10.dist-info → agentstr-0.1.12.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,129 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: agentstr
|
3
|
+
Version: 0.1.12
|
4
|
+
Summary: Nostr extension for Agno AI agents
|
5
|
+
Author-email: Synvya <info@synvya.com>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://www.synvya.com
|
8
|
+
Project-URL: Repository, https://github.com/synvya/agentstr
|
9
|
+
Project-URL: Documentation, https://github.com/synvya/agentstr#readme
|
10
|
+
Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
|
11
|
+
Requires-Python: <3.13,>=3.9
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
License-File: LICENSE
|
14
|
+
Requires-Dist: agno>=1.1.1
|
15
|
+
Requires-Dist: openai>=1.50.0
|
16
|
+
Requires-Dist: packaging>=24.0
|
17
|
+
Requires-Dist: nostr_sdk>=0.39.0
|
18
|
+
Requires-Dist: pydantic>=2.0.0
|
19
|
+
Requires-Dist: cassandra-driver>=3.29.2
|
20
|
+
Requires-Dist: cassio>=0.1.10
|
21
|
+
Provides-Extra: dev
|
22
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
23
|
+
Requires-Dist: pytest-asyncio>=0.23.5; extra == "dev"
|
24
|
+
Requires-Dist: black>=23.0; extra == "dev"
|
25
|
+
Requires-Dist: isort>=5.0; extra == "dev"
|
26
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
27
|
+
Requires-Dist: python-dotenv>=1.0; extra == "dev"
|
28
|
+
|
29
|
+
# AgentStr
|
30
|
+
|
31
|
+
AgentStr is an extension of [Agno](https://www.agno.ai) AI agents that enables peer-to-peer agent communication using the Nostr protocol.
|
32
|
+
|
33
|
+
## Overview
|
34
|
+
|
35
|
+
AgentStr allows AI agents operated by different organizations to communicate and collaborate. For example:
|
36
|
+
- Agent A from Company A can coordinate with Agent B from Company B to execute a transaction
|
37
|
+
- Agents can discover and interact with each other through the decentralized Nostr network
|
38
|
+
- No central authority or intermediary required
|
39
|
+
|
40
|
+
## Project Structure
|
41
|
+
|
42
|
+
```
|
43
|
+
agentstr/
|
44
|
+
├── src/ # Source code
|
45
|
+
│ └── agentstr/
|
46
|
+
│ ├── __init__.py
|
47
|
+
│ ├── buyer.py
|
48
|
+
│ ├── buyer.pyi
|
49
|
+
│ ├── merchant.py
|
50
|
+
│ ├── merchant.pyi
|
51
|
+
│ ├── models.py
|
52
|
+
│ ├── models.pyi
|
53
|
+
│ ├── nostr.py
|
54
|
+
│ ├── nostr.pyi
|
55
|
+
│ └── py.typed
|
56
|
+
├── tests/ # Test files
|
57
|
+
├── docs/ # Documentation
|
58
|
+
├── examples/ # Example implementations
|
59
|
+
└── ...
|
60
|
+
```
|
61
|
+
|
62
|
+
## Features
|
63
|
+
|
64
|
+
### Current Features
|
65
|
+
- Create Merchant agents with Nostr identities:
|
66
|
+
- Publish and manage merchant products using [NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md) marketplace protocol
|
67
|
+
- Create merchant stalls to organize products
|
68
|
+
- Handle shipping zones and costs
|
69
|
+
- Secure communication using Nostr keys
|
70
|
+
- Create Buyer agents:
|
71
|
+
- Retrieve a list of sellers from the relay using [NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md) marketplace protocol
|
72
|
+
- Find an specific seller by name or public key
|
73
|
+
- Refresh the list of sellers from the relay
|
74
|
+
|
75
|
+
### Roadmap
|
76
|
+
- [ ] Create marketplace with stalls
|
77
|
+
- [ ] Expand buyer agent to include more features
|
78
|
+
- [ ] Support additional Nostr NIPs
|
79
|
+
- [ ] Add more agent interaction patterns
|
80
|
+
|
81
|
+
## Installation
|
82
|
+
|
83
|
+
```bash
|
84
|
+
# Create a new python environment
|
85
|
+
python3 -m venv ~/.venvs/aienv
|
86
|
+
source ~/.venvs/aienv/bin/activate
|
87
|
+
|
88
|
+
# Install agentstr
|
89
|
+
pip install --upgrade pip
|
90
|
+
pip install agentstr
|
91
|
+
```
|
92
|
+
|
93
|
+
## Examples
|
94
|
+
|
95
|
+
You can find example code in the [examples](https://github.com/Synvya/agentstr/tree/main/examples/) directory.
|
96
|
+
|
97
|
+
To install the examples clone the repository and navigate to the examples directory:
|
98
|
+
|
99
|
+
```bash
|
100
|
+
git clone https://github.com/Synvya/agentstr.git
|
101
|
+
cd agentstr/examples/
|
102
|
+
```
|
103
|
+
Each example has its own README with instructions on how to run it.
|
104
|
+
|
105
|
+
## Documentation
|
106
|
+
|
107
|
+
For more detailed documentation and examples, see [Docs](https://github.com/Synvya/agentstr/tree/main/docs/docs.md)
|
108
|
+
|
109
|
+
## Development
|
110
|
+
|
111
|
+
See [CONTRIBUTING.md](https://github.com/Synvya/agentstr/blob/main/CONTRIBUTING.md) for:
|
112
|
+
- Development setup
|
113
|
+
- Testing instructions
|
114
|
+
- Contribution guidelines
|
115
|
+
|
116
|
+
## License
|
117
|
+
|
118
|
+
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Synvya/agentstr/blob/main/LICENSE) file for details.
|
119
|
+
|
120
|
+
## Acknowledgments
|
121
|
+
|
122
|
+
- [Agno](https://www.agno.ai) - For their AI agent framework
|
123
|
+
- [Rust-Nostr](https://rust-nostr.org) - For their Python Nostr SDK
|
124
|
+
- [Nostr Protocol](https://github.com/nostr-protocol/nips) - For the protocol specification
|
125
|
+
|
126
|
+
This software includes the following software licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0):
|
127
|
+
- [DataStax Python Driver for Apache Cassandra](https://github.com/datastax/python-driver)
|
128
|
+
- [cassIO](https://github.com/CassioML/cassio). This library is not maintained anymore. We will need to replace it with a new library.
|
129
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
agentstr/__init__.py,sha256=t2nKJcQ0cq3uYc5sadpJGXSO08UViAEfifCQE9pa068,800
|
2
|
+
agentstr/buyer.py,sha256=rifdCC4FSmbLimA94AhSp3UaCA5vxtH61j_KgVJwkVo,9848
|
3
|
+
agentstr/buyer.pyi,sha256=Zs2SbItabztcGg_cJF8_5Mf-p7Me34hxoFHEkC1inDU,1168
|
4
|
+
agentstr/merchant.py,sha256=Uf3LkV5HlyuOZBA-covkUnDYaxI91yHvmVYOD8kk4cM,35225
|
5
|
+
agentstr/merchant.pyi,sha256=bAYP8qz9GTGNeyFEkZsc4CqdCsC2HV4nrV0dWyYu1VY,1440
|
6
|
+
agentstr/models.py,sha256=-anXkTmOANTKw-elxKG-RZCarCGBIWlUHiUoMBrE3FQ,11488
|
7
|
+
agentstr/models.pyi,sha256=QVnjv01cuMynOjzuEcct72yO-LUWpdxEeiEzcf7QTl4,2867
|
8
|
+
agentstr/nostr.py,sha256=VSC5gDN8XM54BSlfQ0yYv2N3DdTVVviWg5VJkJOD5R0,23199
|
9
|
+
agentstr/nostr.pyi,sha256=A-Dq0ZVuZuXEXnMfgVhKRym4ubFnsSjFrgH1Db1JMCI,2647
|
10
|
+
agentstr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
+
agentstr-0.1.12.dist-info/LICENSE,sha256=20H0yoEDN5XO1xPXyZCyJjvSTP0YiarRMKWPfiaBhQY,1063
|
12
|
+
agentstr-0.1.12.dist-info/METADATA,sha256=idnYX1pNr1qsbQXDOTdHmmPBEy3pa9RLdinZn6PeIsE,4475
|
13
|
+
agentstr-0.1.12.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
14
|
+
agentstr-0.1.12.dist-info/top_level.txt,sha256=KZObFRHppZvKUGYB_m9w5HhLwps7jj7w6Xrw73dH2ss,9
|
15
|
+
agentstr-0.1.12.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Basic CLI Agent Example
|
2
|
-
|
3
|
-
This example demonstrates a complete setup of a merchant agent with:
|
4
|
-
- Multiple stalls (Hardware Store and Trade School)
|
5
|
-
- Multiple products per stall
|
6
|
-
- Different shipping zones and costs
|
7
|
-
- Interactive CLI interface
|
8
|
-
|
9
|
-
## Setup
|
10
|
-
|
11
|
-
1. Copy `.env.example` to `.env` and fill in your keys:
|
@@ -1,193 +0,0 @@
|
|
1
|
-
from os import getenv
|
2
|
-
from pathlib import Path
|
3
|
-
from typing import List, Tuple
|
4
|
-
|
5
|
-
import httpx
|
6
|
-
from dotenv import load_dotenv
|
7
|
-
from phi.agent import Agent # type: ignore
|
8
|
-
from phi.model.openai import OpenAIChat # type: ignore
|
9
|
-
|
10
|
-
from agentstr.marketplace import (
|
11
|
-
Merchant,
|
12
|
-
MerchantProduct,
|
13
|
-
MerchantStall,
|
14
|
-
Profile,
|
15
|
-
ShippingCost,
|
16
|
-
ShippingMethod,
|
17
|
-
)
|
18
|
-
|
19
|
-
load_dotenv()
|
20
|
-
|
21
|
-
RELAY = "wss://relay.damus.io"
|
22
|
-
|
23
|
-
# --*-- Merchant info
|
24
|
-
MERCHANT_NAME = "Merchant 1"
|
25
|
-
MERCHANT_DESCRIPTION = "Selling products peer to peer"
|
26
|
-
MERCHANT_PICTURE = "https://i.nostr.build/ocjZ5GlAKwrvgRhx.png"
|
27
|
-
|
28
|
-
# --*-- Stall info
|
29
|
-
STALL_1_NAME = "The Hardware Store"
|
30
|
-
STALL_1_ID = "212au4Pi" # "212a26qV"
|
31
|
-
STALL_1_DESCRIPTION = "Your neighborhood hardware store, now available online."
|
32
|
-
STALL_1_CURRENCY = "Sats"
|
33
|
-
|
34
|
-
STALL_2_NAME = "The Trade School"
|
35
|
-
STALL_2_ID = "c8762EFD"
|
36
|
-
STALL_2_DESCRIPTION = (
|
37
|
-
"Educational videos to put all your hardware supplies to good use."
|
38
|
-
)
|
39
|
-
STALL_2_CURRENCY = "Sats"
|
40
|
-
|
41
|
-
# --*-- Shipping info
|
42
|
-
SHIPPING_ZONE_1_NAME = "North America"
|
43
|
-
SHIPPING_ZONE_1_ID = "64be11rM"
|
44
|
-
SHIPPING_ZONE_1_REGIONS = ["Canada", "Mexico", "USA"]
|
45
|
-
|
46
|
-
SHIPPING_ZONE_2_NAME = "Rest of the World"
|
47
|
-
SHIPPING_ZONE_2_ID = "d041HK7s"
|
48
|
-
SHIPPING_ZONE_2_REGIONS = ["All other countries"]
|
49
|
-
|
50
|
-
SHIPPING_ZONE_3_NAME = "Worldwide"
|
51
|
-
SHIPPING_ZONE_3_ID = "R8Gzz96K"
|
52
|
-
SHIPPING_ZONE_3_REGIONS = ["Worldwide"]
|
53
|
-
|
54
|
-
# --*-- Product info
|
55
|
-
PRODUCT_1_NAME = "Wrench"
|
56
|
-
PRODUCT_1_ID = "bcf00Rx7"
|
57
|
-
PRODUCT_1_DESCRIPTION = "The perfect tool for a $5 wrench attack."
|
58
|
-
PRODUCT_1_IMAGES = ["https://i.nostr.build/BddyYILz0rjv1wEY.png"]
|
59
|
-
PRODUCT_1_CURRENCY = STALL_1_CURRENCY
|
60
|
-
PRODUCT_1_PRICE = 5000
|
61
|
-
PRODUCT_1_QUANTITY = 100
|
62
|
-
|
63
|
-
PRODUCT_2_NAME = "Shovel"
|
64
|
-
PRODUCT_2_ID = "bcf00Rx8"
|
65
|
-
PRODUCT_2_DESCRIPTION = "Dig holes like never before"
|
66
|
-
PRODUCT_2_IMAGES = ["https://i.nostr.build/psL0ZtN4FZcmeiIh.png"]
|
67
|
-
PRODUCT_2_CURRENCY = STALL_1_CURRENCY
|
68
|
-
PRODUCT_2_PRICE = 10000
|
69
|
-
PRODUCT_2_QUANTITY = 10
|
70
|
-
|
71
|
-
PRODUCT_3_NAME = "Shovel 101"
|
72
|
-
PRODUCT_3_ID = "ccf00Rx1"
|
73
|
-
PRODUCT_3_DESCRIPTION = "How to dig your own grave"
|
74
|
-
PRODUCT_3_IMAGES = ["https://i.nostr.build/psL0ZtN4FZcmeiIh.png"]
|
75
|
-
PRODUCT_3_CURRENCY = STALL_2_CURRENCY
|
76
|
-
PRODUCT_3_PRICE = 1000
|
77
|
-
PRODUCT_3_QUANTITY = 1000
|
78
|
-
|
79
|
-
# --*-- Define Shipping methods for stalls (nostr SDK type)
|
80
|
-
shipping_method_1 = (
|
81
|
-
ShippingMethod(id=SHIPPING_ZONE_1_ID, cost=5000)
|
82
|
-
.name(SHIPPING_ZONE_1_NAME)
|
83
|
-
.regions(SHIPPING_ZONE_1_REGIONS)
|
84
|
-
)
|
85
|
-
|
86
|
-
shipping_method_2 = (
|
87
|
-
ShippingMethod(id=SHIPPING_ZONE_2_ID, cost=5000)
|
88
|
-
.name(SHIPPING_ZONE_2_NAME)
|
89
|
-
.regions(SHIPPING_ZONE_2_REGIONS)
|
90
|
-
)
|
91
|
-
|
92
|
-
shipping_method_3 = (
|
93
|
-
ShippingMethod(id=SHIPPING_ZONE_3_ID, cost=0)
|
94
|
-
.name(SHIPPING_ZONE_3_NAME)
|
95
|
-
.regions(SHIPPING_ZONE_3_REGIONS)
|
96
|
-
)
|
97
|
-
|
98
|
-
# --*-- Define Shipping costs for products (nostr SDK type)
|
99
|
-
shipping_cost_1 = ShippingCost(id=SHIPPING_ZONE_1_ID, cost=1000)
|
100
|
-
shipping_cost_2 = ShippingCost(id=SHIPPING_ZONE_2_ID, cost=2000)
|
101
|
-
shipping_cost_3 = ShippingCost(id=SHIPPING_ZONE_3_ID, cost=3000)
|
102
|
-
|
103
|
-
# --*-- define stalls (using ShippingMethod)
|
104
|
-
test_stall_1 = MerchantStall(
|
105
|
-
id=STALL_1_ID,
|
106
|
-
name=STALL_1_NAME,
|
107
|
-
description=STALL_1_DESCRIPTION,
|
108
|
-
currency=STALL_1_CURRENCY,
|
109
|
-
shipping=[shipping_method_1, shipping_method_2],
|
110
|
-
)
|
111
|
-
|
112
|
-
test_stall_2 = MerchantStall(
|
113
|
-
id=STALL_2_ID,
|
114
|
-
name=STALL_2_NAME,
|
115
|
-
description=STALL_2_DESCRIPTION,
|
116
|
-
currency=STALL_2_CURRENCY,
|
117
|
-
shipping=[shipping_method_3], # Uses ShippingMethod
|
118
|
-
)
|
119
|
-
|
120
|
-
# --*-- define products (using ShippingZone)
|
121
|
-
test_product_1 = MerchantProduct(
|
122
|
-
id=PRODUCT_1_ID,
|
123
|
-
stall_id=STALL_1_ID,
|
124
|
-
name=PRODUCT_1_NAME,
|
125
|
-
description=PRODUCT_1_DESCRIPTION,
|
126
|
-
images=PRODUCT_1_IMAGES,
|
127
|
-
currency=PRODUCT_1_CURRENCY,
|
128
|
-
price=PRODUCT_1_PRICE,
|
129
|
-
quantity=PRODUCT_1_QUANTITY,
|
130
|
-
shipping=[shipping_cost_1, shipping_cost_2],
|
131
|
-
categories=None,
|
132
|
-
specs=[], # List of lists of strings, e.g. [["Color", "Red"], ["Size", "Large"]]
|
133
|
-
)
|
134
|
-
|
135
|
-
test_product_2 = MerchantProduct(
|
136
|
-
id=PRODUCT_2_ID,
|
137
|
-
stall_id=STALL_1_ID,
|
138
|
-
name=PRODUCT_2_NAME,
|
139
|
-
description=PRODUCT_2_DESCRIPTION,
|
140
|
-
images=PRODUCT_2_IMAGES,
|
141
|
-
currency=PRODUCT_2_CURRENCY,
|
142
|
-
price=PRODUCT_2_PRICE,
|
143
|
-
quantity=PRODUCT_2_QUANTITY,
|
144
|
-
shipping=[shipping_cost_1, shipping_cost_2],
|
145
|
-
categories=None,
|
146
|
-
specs=[], # List of lists of strings
|
147
|
-
)
|
148
|
-
|
149
|
-
test_product_3 = MerchantProduct(
|
150
|
-
id=PRODUCT_3_ID,
|
151
|
-
stall_id=STALL_2_ID,
|
152
|
-
name=PRODUCT_3_NAME,
|
153
|
-
description=PRODUCT_3_DESCRIPTION,
|
154
|
-
images=PRODUCT_3_IMAGES,
|
155
|
-
currency=PRODUCT_3_CURRENCY,
|
156
|
-
price=PRODUCT_3_PRICE,
|
157
|
-
quantity=PRODUCT_3_QUANTITY,
|
158
|
-
shipping=[shipping_cost_3],
|
159
|
-
categories=None,
|
160
|
-
specs=[], # List of lists of strings
|
161
|
-
)
|
162
|
-
|
163
|
-
nsec = getenv("NSEC_BASIC_CLI_KEY")
|
164
|
-
if nsec:
|
165
|
-
print(f"nsec: {nsec}")
|
166
|
-
else:
|
167
|
-
print(f"No NSEC found")
|
168
|
-
|
169
|
-
|
170
|
-
test_merchant = Profile(MERCHANT_NAME, MERCHANT_DESCRIPTION, MERCHANT_PICTURE, nsec)
|
171
|
-
|
172
|
-
|
173
|
-
agent = Agent( # type: ignore[call-arg]
|
174
|
-
name="Merchant Assistant",
|
175
|
-
model=OpenAIChat(id="gpt-4o"),
|
176
|
-
tools=[
|
177
|
-
Merchant(
|
178
|
-
merchant_profile=test_merchant,
|
179
|
-
relay=RELAY,
|
180
|
-
stalls=[test_stall_1, test_stall_2],
|
181
|
-
products=[test_product_1, test_product_2, test_product_3],
|
182
|
-
)
|
183
|
-
],
|
184
|
-
show_tool_calls=True,
|
185
|
-
debug_mode=True,
|
186
|
-
async_mode=True,
|
187
|
-
instructions=[
|
188
|
-
"The Merchant Toolkit functions return JSON arrays. Provide these JSON arrays back to the console as output."
|
189
|
-
],
|
190
|
-
)
|
191
|
-
|
192
|
-
# agent.print_response("List the products of the merchant")
|
193
|
-
agent.cli_app(stream=False)
|
@@ -1,133 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: agentstr
|
3
|
-
Version: 0.1.10
|
4
|
-
Summary: Nostr extension for Phidata AI agents
|
5
|
-
Author-email: Synvya <info@synvya.com>
|
6
|
-
License: MIT License
|
7
|
-
|
8
|
-
Copyright (c) 2025 Synvya
|
9
|
-
|
10
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
-
of this software and associated documentation files (the "Software"), to deal
|
12
|
-
in the Software without restriction, including without limitation the rights
|
13
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
-
copies of the Software, and to permit persons to whom the Software is
|
15
|
-
furnished to do so, subject to the following conditions:
|
16
|
-
|
17
|
-
The above copyright notice and this permission notice shall be included in all
|
18
|
-
copies or substantial portions of the Software.
|
19
|
-
|
20
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
-
SOFTWARE.
|
27
|
-
|
28
|
-
Project-URL: Homepage, https://github.com/synvya/agentstr
|
29
|
-
Project-URL: Documentation, https://github.com/synvya/agentstr#readme
|
30
|
-
Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
|
31
|
-
Requires-Python: <3.13,>=3.9
|
32
|
-
Description-Content-Type: text/markdown
|
33
|
-
License-File: LICENSE
|
34
|
-
Requires-Dist: phidata>=2.7.0
|
35
|
-
Requires-Dist: openai>=1.50.0
|
36
|
-
Requires-Dist: packaging>=24.0
|
37
|
-
Requires-Dist: nostr-sdk>=0.38.0
|
38
|
-
Requires-Dist: pydantic>=2.0.0
|
39
|
-
Provides-Extra: dev
|
40
|
-
Requires-Dist: pytest>=7.0; extra == "dev"
|
41
|
-
Requires-Dist: black>=23.0; extra == "dev"
|
42
|
-
Requires-Dist: isort>=5.0; extra == "dev"
|
43
|
-
Requires-Dist: mypy>=1.0; extra == "dev"
|
44
|
-
Requires-Dist: python-dotenv>=1.0; extra == "dev"
|
45
|
-
|
46
|
-
# AgentStr
|
47
|
-
|
48
|
-
AgentStr is an extension of [Phidata](https://www.phidata.com) AI agents that enables peer-to-peer agent communication using the Nostr protocol.
|
49
|
-
|
50
|
-
## Overview
|
51
|
-
|
52
|
-
AgentStr allows AI agents operated by different organizations to communicate and collaborate. For example:
|
53
|
-
- Agent A from Company A can coordinate with Agent B from Company B to execute a transaction
|
54
|
-
- Agents can discover and interact with each other through the decentralized Nostr network
|
55
|
-
- No central authority or intermediary required
|
56
|
-
|
57
|
-
## Project Structure
|
58
|
-
|
59
|
-
```
|
60
|
-
agentstr/
|
61
|
-
├── src/ # Source code
|
62
|
-
│ └── agentstr/
|
63
|
-
│ ├── __init__.py
|
64
|
-
│ ├── marketplace.py
|
65
|
-
│ └── nostr.py
|
66
|
-
├── tests/ # Test files
|
67
|
-
├── docs/ # Documentation
|
68
|
-
├── examples/ # Example implementations
|
69
|
-
└── ...
|
70
|
-
```
|
71
|
-
|
72
|
-
## Features
|
73
|
-
|
74
|
-
### Current Features
|
75
|
-
- Create Merchant agents with Nostr identities
|
76
|
-
- Publish and manage merchant products using [NIP-15](https://github.com/nostr-protocol/nips/blob/master/15.md) marketplace protocol
|
77
|
-
- Create merchant stalls to organize products
|
78
|
-
- Handle shipping zones and costs
|
79
|
-
- Secure communication using Nostr keys
|
80
|
-
|
81
|
-
### Roadmap
|
82
|
-
- [ ] Create marketplace with stalls
|
83
|
-
- [ ] Create Buyer agents
|
84
|
-
- [ ] Enable merchants to define products
|
85
|
-
- [ ] Add customer toolkit for buyers
|
86
|
-
- [ ] Support additional Nostr NIPs
|
87
|
-
- [ ] Add more agent interaction patterns
|
88
|
-
|
89
|
-
## Installation
|
90
|
-
|
91
|
-
```bash
|
92
|
-
# Create a new python environment
|
93
|
-
python3 -m venv ~/.venvs/aienv
|
94
|
-
source ~/.venvs/aienv/bin/activate
|
95
|
-
|
96
|
-
# Install agentstr
|
97
|
-
pip install --upgrade pip
|
98
|
-
pip install agentstr
|
99
|
-
```
|
100
|
-
|
101
|
-
## Examples
|
102
|
-
|
103
|
-
See our [examples directory](https://github.com/Synvya/agentstr/tree/main/examples/) for complete working implementations:
|
104
|
-
|
105
|
-
- [Basic CLI Agent](https://github.com/Synvya/agentstr/tree/main/examples/basic_cli/main.py) - A complete example showing:
|
106
|
-
- Setting up merchant profiles
|
107
|
-
- Creating stalls with shipping methods
|
108
|
-
- Defining products with shipping costs
|
109
|
-
- Configuring the agent with the merchant toolkit
|
110
|
-
- Running an interactive CLI application
|
111
|
-
|
112
|
-
|
113
|
-
## Documentation
|
114
|
-
|
115
|
-
For more detailed documentation and examples, see [Docs](https://github.com/Synvya/agentstr/tree/main/docs/docs.md)
|
116
|
-
|
117
|
-
## Development
|
118
|
-
|
119
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for:
|
120
|
-
- Development setup
|
121
|
-
- Testing instructions
|
122
|
-
- Contribution guidelines
|
123
|
-
|
124
|
-
## License
|
125
|
-
|
126
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
127
|
-
|
128
|
-
## Acknowledgments
|
129
|
-
|
130
|
-
- [Phidata](https://www.phidata.com) - For their AI agent framework
|
131
|
-
- [Rust-Nostr](https://rust-nostr.org) - For their Python Nostr SDK
|
132
|
-
- [Nostr Protocol](https://github.com/nostr-protocol/nips) - For the protocol specification
|
133
|
-
|
agentstr-0.1.10.dist-info/RECORD
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
agentstr/__init__.py,sha256=bPXCN4fDtqII9UtDCwhWhkR6bi1LR4w0rR0vGeKPNoI,567
|
2
|
-
agentstr/marketplace.py,sha256=CavX0WQaCiz1sQhVs-PaHZ4YYUdcabW5V5eXrhtbT5A,40406
|
3
|
-
agentstr/nostr.py,sha256=PId6477VuShPq7nKgansgyJhJNNy9S8ycCf_3niizg4,11242
|
4
|
-
agentstr/examples/basic_cli/.env.example,sha256=yt6kWhUgnV2wlDlilpiOIZDdJtYL_QVhtbCGl7EG58c,76
|
5
|
-
agentstr/examples/basic_cli/README.md,sha256=ibZ1LMOZj1BGjtDxxhTLvHwbG-H6NqfobP_zPCJoYZM,310
|
6
|
-
agentstr/examples/basic_cli/main.py,sha256=Jgzvk0ep1zFHbDns5SQzJQvDMTQqBuRdsFSkfqEc5S8,5418
|
7
|
-
agentstr-0.1.10.dist-info/LICENSE,sha256=20H0yoEDN5XO1xPXyZCyJjvSTP0YiarRMKWPfiaBhQY,1063
|
8
|
-
agentstr-0.1.10.dist-info/METADATA,sha256=3XSiQurtRGtTWnXvrYqdZQpXu0ry7yF0_Rot6SdfWg0,4792
|
9
|
-
agentstr-0.1.10.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
-
agentstr-0.1.10.dist-info/top_level.txt,sha256=KZObFRHppZvKUGYB_m9w5HhLwps7jj7w6Xrw73dH2ss,9
|
11
|
-
agentstr-0.1.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|