agentstr 0.1.14__py3-none-any.whl → 0.1.16__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentstr/__init__.py +2 -1
- agentstr/buyer.py +48 -26
- agentstr/buyer.pyi +7 -3
- agentstr/merchant.py +2 -0
- agentstr/models.py +15 -4
- agentstr/models.pyi +5 -2
- agentstr/nostr.py +80 -5
- agentstr/nostr.pyi +19 -2
- {agentstr-0.1.14.dist-info → agentstr-0.1.16.dist-info}/METADATA +6 -8
- agentstr-0.1.16.dist-info/RECORD +15 -0
- {agentstr-0.1.14.dist-info → agentstr-0.1.16.dist-info}/WHEEL +1 -1
- agentstr-0.1.14.dist-info/RECORD +0 -15
- {agentstr-0.1.14.dist-info → agentstr-0.1.16.dist-info}/LICENSE +0 -0
- {agentstr-0.1.14.dist-info → agentstr-0.1.16.dist-info}/top_level.txt +0 -0
agentstr/__init__.py
CHANGED
@@ -5,7 +5,7 @@ AgentStr: Nostr extension for Agno AI agents
|
|
5
5
|
import importlib.metadata
|
6
6
|
import logging
|
7
7
|
|
8
|
-
from nostr_sdk import ShippingCost, ShippingMethod, Timestamp # type: ignore
|
8
|
+
from nostr_sdk import PublicKey, ShippingCost, ShippingMethod, Timestamp # type: ignore
|
9
9
|
|
10
10
|
from agentstr.nostr import EventId, Keys, Kind, NostrClient, generate_and_save_keys
|
11
11
|
|
@@ -43,6 +43,7 @@ __all__ = [
|
|
43
43
|
"NostrClient",
|
44
44
|
"generate_and_save_keys",
|
45
45
|
"Timestamp",
|
46
|
+
"PublicKey",
|
46
47
|
# Models
|
47
48
|
"AgentProfile",
|
48
49
|
"NostrProfile",
|
agentstr/buyer.py
CHANGED
@@ -4,7 +4,6 @@ Module implementing the BuyerTools Toolkit for Agno agents.
|
|
4
4
|
|
5
5
|
import json
|
6
6
|
import logging
|
7
|
-
from uuid import uuid4
|
8
7
|
|
9
8
|
from pydantic import ConfigDict
|
10
9
|
|
@@ -82,6 +81,8 @@ class BuyerTools(Toolkit):
|
|
82
81
|
self._nostr_client = NostrClient(relay, buyer_profile.get_private_key())
|
83
82
|
|
84
83
|
# Register methods
|
84
|
+
self.register(self.download_all_sellers)
|
85
|
+
self.register(self.download_sellers_from_marketplace)
|
85
86
|
self.register(self.find_seller_by_name)
|
86
87
|
self.register(self.find_seller_by_public_key)
|
87
88
|
self.register(self.find_sellers_by_location)
|
@@ -91,7 +92,6 @@ class BuyerTools(Toolkit):
|
|
91
92
|
self.register(self.get_seller_products)
|
92
93
|
self.register(self.get_seller_count)
|
93
94
|
self.register(self.get_sellers)
|
94
|
-
self.register(self.refresh_sellers)
|
95
95
|
self.register(self.purchase_product)
|
96
96
|
|
97
97
|
def purchase_product(self, product: str) -> str:
|
@@ -107,6 +107,30 @@ class BuyerTools(Toolkit):
|
|
107
107
|
{"status": "success", "message": f"Product {product} purchased"}
|
108
108
|
)
|
109
109
|
|
110
|
+
def download_all_sellers(self) -> str:
|
111
|
+
"""Download all sellers from the Nostr relay.
|
112
|
+
|
113
|
+
Returns:
|
114
|
+
str: JSON string with status and count of sellers refreshed
|
115
|
+
"""
|
116
|
+
self._download_all_sellers()
|
117
|
+
response = json.dumps({"status": "success", "count": len(self.sellers)})
|
118
|
+
return response
|
119
|
+
|
120
|
+
def download_sellers_from_marketplace(self, owner: str, name: str) -> str:
|
121
|
+
"""Download sellers from a marketplace.
|
122
|
+
|
123
|
+
Args:
|
124
|
+
owner: bech32 encoded public key of the owner of the marketplace
|
125
|
+
name: name of the marketplace to download sellers from
|
126
|
+
|
127
|
+
Returns:
|
128
|
+
str: JSON string with status and count of sellers downloaded
|
129
|
+
"""
|
130
|
+
self._download_sellers_from_marketplace(PublicKey.parse(owner), name)
|
131
|
+
response = json.dumps({"status": "success", "count": len(self.sellers)})
|
132
|
+
return response
|
133
|
+
|
110
134
|
def find_seller_by_name(self, name: str) -> str:
|
111
135
|
"""Find a seller by name.
|
112
136
|
|
@@ -256,37 +280,23 @@ class BuyerTools(Toolkit):
|
|
256
280
|
return response
|
257
281
|
|
258
282
|
def get_sellers(self) -> str:
|
259
|
-
"""Get the list of sellers.
|
260
|
-
|
261
|
-
|
262
|
-
To get a fresh list of sellers, call refresh_sellers() sellers first.
|
283
|
+
"""Get the list of sellers cached in the BuyerTools instance.
|
284
|
+
To get a fresh list of sellers, call download_all_sellers() or
|
285
|
+
get_sellers_from_marketplace() first.
|
263
286
|
|
264
287
|
Returns:
|
265
288
|
str: list of sellers json strings
|
266
289
|
"""
|
267
|
-
if not self.sellers:
|
268
|
-
|
290
|
+
# if not self.sellers:
|
291
|
+
# self._refresh_sellers()
|
269
292
|
response = json.dumps([seller.to_json() for seller in self.sellers])
|
270
293
|
return response
|
271
294
|
|
272
|
-
def
|
273
|
-
"""Refresh the list of sellers.
|
274
|
-
|
275
|
-
Returns:
|
276
|
-
str: JSON string with status and count of sellers refreshed
|
277
|
-
"""
|
278
|
-
self._refresh_sellers()
|
279
|
-
response = json.dumps({"status": "success", "count": len(self.sellers)})
|
280
|
-
return response
|
281
|
-
|
282
|
-
def _refresh_sellers(self) -> None:
|
295
|
+
def _download_all_sellers(self) -> None:
|
283
296
|
"""
|
284
|
-
Internal fucntion to retrieve a new
|
285
|
-
The old
|
297
|
+
Internal fucntion to retrieve a new set of sellers from the Nostr relay.
|
298
|
+
The old set is discarded and the new set only contains unique sellers
|
286
299
|
currently stored at the relay.
|
287
|
-
|
288
|
-
Returns:
|
289
|
-
List[NostrProfile]: List of Nostr profiles of all sellers.
|
290
300
|
"""
|
291
301
|
sellers = self._nostr_client.retrieve_sellers()
|
292
302
|
if len(sellers) == 0:
|
@@ -296,10 +306,22 @@ class BuyerTools(Toolkit):
|
|
296
306
|
|
297
307
|
self.sellers = sellers
|
298
308
|
|
309
|
+
def _download_sellers_from_marketplace(self, owner: PublicKey, name: str) -> None:
|
310
|
+
"""
|
311
|
+
Internal function to download sellers from a marketplace and store them as
|
312
|
+
the new set of sellers for the BuyerTools instance.
|
313
|
+
|
314
|
+
Args:
|
315
|
+
owner: PublicKey of the owner of the marketplace
|
316
|
+
name: name of the marketplace to download sellers from
|
317
|
+
"""
|
318
|
+
sellers = self._nostr_client.retrieve_marketplace(owner, name)
|
319
|
+
self.sellers = sellers
|
320
|
+
|
299
321
|
def _store_response_in_knowledge_base(self, response: str) -> None:
|
300
322
|
doc = Document(
|
301
|
-
id=str(uuid4()),
|
323
|
+
# id=str(uuid4()),
|
302
324
|
content=response,
|
303
325
|
)
|
304
|
-
|
326
|
+
print(f"Document length: {len(doc.content.split())} words")
|
305
327
|
self.knowledge_base.load_documents([doc]) # Store response in Cassandra
|
agentstr/buyer.pyi
CHANGED
@@ -5,7 +5,7 @@ from agno.agent import AgentKnowledge
|
|
5
5
|
from agno.tools import Toolkit
|
6
6
|
|
7
7
|
from agentstr.models import AgentProfile, NostrProfile
|
8
|
-
from agentstr.nostr import NostrClient
|
8
|
+
from agentstr.nostr import NostrClient, PublicKey
|
9
9
|
|
10
10
|
class BuyerTools(Toolkit):
|
11
11
|
logger: ClassVar[Logger]
|
@@ -16,6 +16,8 @@ class BuyerTools(Toolkit):
|
|
16
16
|
def __init__(
|
17
17
|
self, knowledge_base: AgentKnowledge, buyer_profile: AgentProfile, relay: str
|
18
18
|
) -> None: ...
|
19
|
+
def download_sellers_from_marketplace(self, owner: PublicKey, name: str) -> str: ...
|
20
|
+
def download_all_sellers(self) -> str: ...
|
19
21
|
def find_seller_by_name(self, name: str) -> str: ...
|
20
22
|
def find_seller_by_public_key(self, public_key: str) -> str: ...
|
21
23
|
def find_sellers_by_location(self, location: str) -> str: ...
|
@@ -27,6 +29,8 @@ class BuyerTools(Toolkit):
|
|
27
29
|
def get_seller_products(self, public_key: str) -> str: ...
|
28
30
|
def get_sellers(self) -> str: ...
|
29
31
|
def purchase_product(self, product: str) -> str: ...
|
30
|
-
def
|
31
|
-
def
|
32
|
+
def _download_all_sellers(self) -> None: ...
|
33
|
+
def _download_sellers_from_marketplace(
|
34
|
+
self, owner: PublicKey, name: str
|
35
|
+
) -> None: ...
|
32
36
|
def _store_response_in_knowledge_base(self, response: str) -> None: ...
|
agentstr/merchant.py
CHANGED
@@ -437,6 +437,8 @@ class MerchantTools(Toolkit):
|
|
437
437
|
self.merchant_profile.get_name(),
|
438
438
|
self.merchant_profile.get_about(),
|
439
439
|
self.merchant_profile.get_picture(),
|
440
|
+
self.merchant_profile.get_banner(),
|
441
|
+
self.merchant_profile.get_website(),
|
440
442
|
)
|
441
443
|
return json.dumps(event_id.__dict__)
|
442
444
|
except RuntimeError as e:
|
agentstr/models.py
CHANGED
@@ -31,6 +31,7 @@ class Profile:
|
|
31
31
|
|
32
32
|
def __init__(self) -> None:
|
33
33
|
self.about = ""
|
34
|
+
self.banner = ""
|
34
35
|
self.display_name = ""
|
35
36
|
self.name = ""
|
36
37
|
self.picture = ""
|
@@ -39,6 +40,9 @@ class Profile:
|
|
39
40
|
def get_about(self) -> str:
|
40
41
|
return self.about
|
41
42
|
|
43
|
+
def get_banner(self) -> str:
|
44
|
+
return self.banner
|
45
|
+
|
42
46
|
def get_display_name(self) -> str:
|
43
47
|
return self.display_name
|
44
48
|
|
@@ -54,6 +58,9 @@ class Profile:
|
|
54
58
|
def set_about(self, about: str) -> None:
|
55
59
|
self.about = about
|
56
60
|
|
61
|
+
def set_banner(self, banner: str) -> None:
|
62
|
+
self.banner = banner
|
63
|
+
|
57
64
|
def set_display_name(self, display_name: str) -> None:
|
58
65
|
self.display_name = display_name
|
59
66
|
|
@@ -71,6 +78,7 @@ class Profile:
|
|
71
78
|
"name": self.name,
|
72
79
|
"display_name": self.display_name,
|
73
80
|
"about": self.about,
|
81
|
+
"banner": self.banner,
|
74
82
|
"picture": self.picture,
|
75
83
|
"website": self.website,
|
76
84
|
}
|
@@ -85,12 +93,12 @@ class NostrProfile(Profile):
|
|
85
93
|
a third party profile and therefore it only has a public key.
|
86
94
|
"""
|
87
95
|
|
88
|
-
|
96
|
+
PROFILE_URL_PREFIX: str = "https://primal.net/p/"
|
89
97
|
|
90
98
|
def __init__(self, public_key: PublicKey) -> None:
|
91
99
|
super().__init__()
|
92
100
|
self.public_key = public_key
|
93
|
-
self.profile_url = self.
|
101
|
+
self.profile_url = self.PROFILE_URL_PREFIX + self.public_key.to_bech32()
|
94
102
|
# Initialize the locations set here, per-instance
|
95
103
|
self.locations: set[str] = set()
|
96
104
|
|
@@ -98,6 +106,7 @@ class NostrProfile(Profile):
|
|
98
106
|
def from_metadata(cls, metadata: Metadata, public_key: PublicKey) -> "NostrProfile":
|
99
107
|
profile = cls(public_key)
|
100
108
|
profile.set_about(metadata.get_about())
|
109
|
+
profile.set_banner(metadata.get_banner())
|
101
110
|
profile.set_display_name(metadata.get_display_name())
|
102
111
|
profile.set_name(metadata.get_name())
|
103
112
|
profile.set_picture(metadata.get_picture())
|
@@ -171,6 +180,7 @@ class NostrProfile(Profile):
|
|
171
180
|
"name": self.name,
|
172
181
|
"display_name": self.display_name,
|
173
182
|
"about": self.about,
|
183
|
+
"banner": self.banner,
|
174
184
|
"picture": self.picture,
|
175
185
|
"website": self.website,
|
176
186
|
}
|
@@ -181,17 +191,18 @@ class AgentProfile(Profile):
|
|
181
191
|
AgentProfile is a Profile that is used to represent an agent.
|
182
192
|
"""
|
183
193
|
|
184
|
-
|
194
|
+
PROFILE_URL_PREFIX: str = "https://primal.net/p/"
|
185
195
|
|
186
196
|
def __init__(self, keys: Keys) -> None:
|
187
197
|
super().__init__()
|
188
198
|
self.keys = keys
|
189
|
-
self.profile_url = self.
|
199
|
+
self.profile_url = self.PROFILE_URL_PREFIX + self.keys.public_key().to_bech32()
|
190
200
|
|
191
201
|
@classmethod
|
192
202
|
def from_metadata(cls, metadata: Metadata, keys: Keys) -> "AgentProfile":
|
193
203
|
profile = cls(keys)
|
194
204
|
profile.set_about(metadata.get_about())
|
205
|
+
profile.set_banner(metadata.get_banner())
|
195
206
|
profile.set_display_name(metadata.get_display_name())
|
196
207
|
profile.set_name(metadata.get_name())
|
197
208
|
profile.set_picture(metadata.get_picture())
|
agentstr/models.pyi
CHANGED
@@ -19,6 +19,7 @@ class Profile:
|
|
19
19
|
|
20
20
|
logger: ClassVar[Logger]
|
21
21
|
about: str
|
22
|
+
banner: str
|
22
23
|
display_name: str
|
23
24
|
name: str
|
24
25
|
picture: str
|
@@ -26,11 +27,13 @@ class Profile:
|
|
26
27
|
|
27
28
|
def __init__(self) -> None: ...
|
28
29
|
def get_about(self) -> str: ...
|
30
|
+
def get_banner(self) -> str: ...
|
29
31
|
def get_display_name(self) -> str: ...
|
30
32
|
def get_name(self) -> str: ...
|
31
33
|
def get_picture(self) -> str: ...
|
32
34
|
def get_website(self) -> str: ...
|
33
35
|
def set_about(self, about: str) -> None: ...
|
36
|
+
def set_banner(self, banner: str) -> None: ...
|
34
37
|
def set_display_name(self, display_name: str) -> None: ...
|
35
38
|
def set_name(self, name: str) -> None: ...
|
36
39
|
def set_picture(self, picture: str) -> None: ...
|
@@ -38,7 +41,7 @@ class Profile:
|
|
38
41
|
def to_json(self) -> str: ...
|
39
42
|
|
40
43
|
class AgentProfile(Profile):
|
41
|
-
|
44
|
+
PROFILE_URL_PREFIX: ClassVar[str]
|
42
45
|
profile_url: str
|
43
46
|
keys: Keys
|
44
47
|
|
@@ -52,7 +55,7 @@ class AgentProfile(Profile):
|
|
52
55
|
class NostrProfile(Profile):
|
53
56
|
public_key: PublicKey
|
54
57
|
profile_url: str
|
55
|
-
|
58
|
+
PROFILE_URL_PREFIX: ClassVar[str]
|
56
59
|
locations: Set[str]
|
57
60
|
|
58
61
|
def __init__(self, public_key: PublicKey) -> None: ...
|
agentstr/nostr.py
CHANGED
@@ -144,14 +144,23 @@ class NostrClient:
|
|
144
144
|
except Exception as e:
|
145
145
|
raise RuntimeError(f"Failed to publish product: {e}") from e
|
146
146
|
|
147
|
-
def publish_profile(
|
147
|
+
def publish_profile(
|
148
|
+
self,
|
149
|
+
name: str,
|
150
|
+
about: str,
|
151
|
+
picture: str,
|
152
|
+
banner: str,
|
153
|
+
website: Optional[str] = None,
|
154
|
+
) -> EventId:
|
148
155
|
"""
|
149
156
|
Publish a Nostr profile with event kind 0
|
150
157
|
|
151
158
|
Args:
|
152
159
|
name: name of the Nostr profile
|
153
160
|
about: brief description about the profile
|
154
|
-
picture: url to a
|
161
|
+
picture: url to a file with a picture for the profile
|
162
|
+
banner: url to a file with a banner for the profile
|
163
|
+
website: optional url to a website for the profile
|
155
164
|
|
156
165
|
Returns:
|
157
166
|
EventId: event id if successful
|
@@ -160,7 +169,9 @@ class NostrClient:
|
|
160
169
|
RuntimeError: if the profile can't be published
|
161
170
|
"""
|
162
171
|
# Run the async publishing function synchronously
|
163
|
-
return asyncio.run(
|
172
|
+
return asyncio.run(
|
173
|
+
self._async_publish_profile(name, about, picture, banner, website)
|
174
|
+
)
|
164
175
|
|
165
176
|
def publish_stall(self, stall: MerchantStall) -> EventId:
|
166
177
|
"""Publish a stall to nostr
|
@@ -179,6 +190,41 @@ class NostrClient:
|
|
179
190
|
except Exception as e:
|
180
191
|
raise RuntimeError(f"Failed to publish stall: {e}") from e
|
181
192
|
|
193
|
+
def retrieve_marketplace(self, owner: PublicKey, name: str) -> set[NostrProfile]:
|
194
|
+
"""
|
195
|
+
Retrieve all sellers from the marketplace.
|
196
|
+
|
197
|
+
Args:
|
198
|
+
owner: PublicKey of the owner of the marketplace
|
199
|
+
name: name of the marketplace
|
200
|
+
|
201
|
+
Returns:
|
202
|
+
set[NostrProfile]: set of seller profiles.
|
203
|
+
(skips authors with missing metadata)
|
204
|
+
"""
|
205
|
+
events_filter = Filter().kind(Kind(30019)).authors([owner])
|
206
|
+
try:
|
207
|
+
events = asyncio.run(self._async_retrieve_events(events_filter))
|
208
|
+
except Exception as e:
|
209
|
+
raise RuntimeError(f"Failed to retrieve marketplace: {e}") from e
|
210
|
+
|
211
|
+
events_list = events.to_vec()
|
212
|
+
merchants_dict: Dict[PublicKey, NostrProfile] = {}
|
213
|
+
|
214
|
+
for event in events_list:
|
215
|
+
content = json.loads(event.content())
|
216
|
+
if content.get("name") == name:
|
217
|
+
merchants = content.get("merchants", [])
|
218
|
+
for merchant in merchants:
|
219
|
+
try:
|
220
|
+
public_key = PublicKey.parse(merchant)
|
221
|
+
profile = asyncio.run(self._async_retrieve_profile(public_key))
|
222
|
+
merchants_dict[public_key] = profile
|
223
|
+
except RuntimeError:
|
224
|
+
continue
|
225
|
+
|
226
|
+
return set(merchants_dict.values())
|
227
|
+
|
182
228
|
def retrieve_products_from_seller(self, seller: PublicKey) -> List[MerchantProduct]:
|
183
229
|
"""
|
184
230
|
Retrieve all products from a given seller.
|
@@ -451,7 +497,12 @@ class NostrClient:
|
|
451
497
|
return await self._async_publish_event(good_event_builder)
|
452
498
|
|
453
499
|
async def _async_publish_profile(
|
454
|
-
self,
|
500
|
+
self,
|
501
|
+
name: str,
|
502
|
+
about: str,
|
503
|
+
picture: str,
|
504
|
+
banner: str,
|
505
|
+
website: Optional[str] = None,
|
455
506
|
) -> EventId:
|
456
507
|
"""
|
457
508
|
Asynchronous function to publish a Nostr profile with event kind 0
|
@@ -459,7 +510,9 @@ class NostrClient:
|
|
459
510
|
Args:
|
460
511
|
name: name of the Nostr profile
|
461
512
|
about: brief description about the profile
|
462
|
-
picture: url to a
|
513
|
+
picture: url to a file with a picture for the profile
|
514
|
+
banner: url to a file with a banner for the profile
|
515
|
+
website: optional url to a website for the profile
|
463
516
|
|
464
517
|
Returns:
|
465
518
|
EventId: event id if successful
|
@@ -469,8 +522,13 @@ class NostrClient:
|
|
469
522
|
"""
|
470
523
|
metadata_content = Metadata().set_name(name)
|
471
524
|
metadata_content = metadata_content.set_about(about)
|
525
|
+
print(f"Banner: {banner}")
|
526
|
+
metadata_content = metadata_content.set_banner(banner)
|
472
527
|
metadata_content = metadata_content.set_picture(picture)
|
473
528
|
|
529
|
+
if website:
|
530
|
+
metadata_content = metadata_content.set_website(website)
|
531
|
+
|
474
532
|
event_builder = EventBuilder.metadata(metadata_content)
|
475
533
|
return await self._async_publish_event(event_builder)
|
476
534
|
|
@@ -529,6 +587,23 @@ class NostrClient:
|
|
529
587
|
except Exception as e:
|
530
588
|
raise RuntimeError(f"Unable to retrieve stalls: {e}") from e
|
531
589
|
|
590
|
+
async def _async_retrieve_events(self, events_filter: Filter) -> Events:
|
591
|
+
"""
|
592
|
+
Asynchronous function to retrieve events from the relay
|
593
|
+
"""
|
594
|
+
try:
|
595
|
+
await self._async_connect()
|
596
|
+
except Exception as e:
|
597
|
+
raise RuntimeError("Unable to connect to the relay") from e
|
598
|
+
|
599
|
+
try:
|
600
|
+
events = await self.client.fetch_events_from(
|
601
|
+
urls=[self.relay], filter=events_filter, timeout=timedelta(seconds=2)
|
602
|
+
)
|
603
|
+
return events
|
604
|
+
except Exception as e:
|
605
|
+
raise RuntimeError(f"Unable to retrieve stalls: {e}") from e
|
606
|
+
|
532
607
|
async def _async_retrieve_products_from_seller(self, seller: PublicKey) -> Events:
|
533
608
|
"""
|
534
609
|
Asynchronous function to retrieve the products for a given author
|
agentstr/nostr.pyi
CHANGED
@@ -18,6 +18,7 @@ from nostr_sdk import ( # type: ignore
|
|
18
18
|
EventBuilder,
|
19
19
|
EventId,
|
20
20
|
Events,
|
21
|
+
Filter,
|
21
22
|
Keys,
|
22
23
|
Kind,
|
23
24
|
Metadata,
|
@@ -68,8 +69,18 @@ class NostrClient:
|
|
68
69
|
def publish_event(self, event_builder: EventBuilder) -> EventId: ...
|
69
70
|
def publish_note(self, text: str) -> EventId: ...
|
70
71
|
def publish_product(self, product: MerchantProduct) -> EventId: ...
|
71
|
-
def publish_profile(
|
72
|
+
def publish_profile(
|
73
|
+
self,
|
74
|
+
name: str,
|
75
|
+
about: str,
|
76
|
+
picture: str,
|
77
|
+
banner: str,
|
78
|
+
website: Optional[str] = None,
|
79
|
+
) -> EventId: ...
|
72
80
|
def publish_stall(self, stall: MerchantStall) -> EventId: ...
|
81
|
+
def retrieve_marketplace(
|
82
|
+
self, owner: PublicKey, name: str
|
83
|
+
) -> set[NostrProfile]: ...
|
73
84
|
def retrieve_products_from_seller(
|
74
85
|
self, seller: PublicKey
|
75
86
|
) -> List[MerchantProduct]: ...
|
@@ -83,10 +94,16 @@ class NostrClient:
|
|
83
94
|
async def _async_publish_note(self, text: str) -> EventId: ...
|
84
95
|
async def _async_publish_product(self, product: MerchantProduct) -> EventId: ...
|
85
96
|
async def _async_publish_profile(
|
86
|
-
self,
|
97
|
+
self,
|
98
|
+
name: str,
|
99
|
+
about: str,
|
100
|
+
picture: str,
|
101
|
+
banner: str,
|
102
|
+
website: Optional[str] = None,
|
87
103
|
) -> EventId: ...
|
88
104
|
async def _async_publish_stall(self, stall: MerchantStall) -> EventId: ...
|
89
105
|
async def _async_retrieve_all_stalls(self) -> Events: ...
|
106
|
+
async def _async_retrieve_events(self, events_filter: Filter) -> Events: ...
|
90
107
|
async def _async_retrieve_products_from_seller(
|
91
108
|
self, seller: PublicKey
|
92
109
|
) -> Events: ...
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: agentstr
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.16
|
4
4
|
Summary: Tools for a Nostr agentic ecosystem
|
5
5
|
Author-email: Synvya <synvya@synvya.com>
|
6
6
|
License: MIT
|
@@ -8,7 +8,7 @@ Project-URL: Homepage, https://www.synvya.com
|
|
8
8
|
Project-URL: Repository, https://github.com/synvya/agentstr
|
9
9
|
Project-URL: Documentation, https://github.com/synvya/agentstr#readme
|
10
10
|
Project-URL: BugTracker, https://github.com/synvya/agentstr/issues
|
11
|
-
Requires-Python: <3.13,>=3.
|
11
|
+
Requires-Python: <3.13,>=3.10
|
12
12
|
Description-Content-Type: text/markdown
|
13
13
|
License-File: LICENSE
|
14
14
|
Requires-Dist: agno>=1.1.1
|
@@ -24,8 +24,10 @@ Requires-Dist: mypy>=1.0; extra == "dev"
|
|
24
24
|
Requires-Dist: pylint>=3.0; extra == "dev"
|
25
25
|
Provides-Extra: examples
|
26
26
|
Requires-Dist: python-dotenv>=1.0; extra == "examples"
|
27
|
-
Requires-Dist:
|
28
|
-
Requires-Dist:
|
27
|
+
Requires-Dist: psycopg[binary]>=3.2.5; extra == "examples"
|
28
|
+
Requires-Dist: sqlalchemy>=2.0.0; extra == "examples"
|
29
|
+
Requires-Dist: nest-asyncio>=1.6.0; extra == "examples"
|
30
|
+
Requires-Dist: pgvector>=0.3.6; extra == "examples"
|
29
31
|
Requires-Dist: fastapi>=0.110.0; extra == "examples"
|
30
32
|
Requires-Dist: uvicorn>=0.30.0; extra == "examples"
|
31
33
|
|
@@ -126,7 +128,3 @@ This project is licensed under the MIT License - see the [LICENSE](https://githu
|
|
126
128
|
- [Rust-Nostr](https://rust-nostr.org) - For their Python Nostr SDK
|
127
129
|
- [Nostr Protocol](https://github.com/nostr-protocol/nips) - For the protocol specification
|
128
130
|
|
129
|
-
This software includes the following software licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0):
|
130
|
-
- [DataStax Python Driver for Apache Cassandra](https://github.com/datastax/python-driver)
|
131
|
-
- [cassIO](https://github.com/CassioML/cassio). This library is not maintained anymore. We will need to replace it with a new library.
|
132
|
-
|
@@ -0,0 +1,15 @@
|
|
1
|
+
agentstr/__init__.py,sha256=lq5pzT6dySl5CAL6CtteLBPhZ2_u0eJ9a75UPd0-u74,1322
|
2
|
+
agentstr/buyer.py,sha256=6NKfqdYuIRmG9R_uVSGH9DFPeA3eHOzWV-H8ArzeKWs,10897
|
3
|
+
agentstr/buyer.pyi,sha256=Tiru-tuXKht55r1qhOUI49W-E7-5R3WP2YwwqUiQ5Po,1434
|
4
|
+
agentstr/merchant.py,sha256=n-ZNKNbKhjej7fEyScexb2ZP_vwpMWjez17YsaX5lFM,35183
|
5
|
+
agentstr/merchant.pyi,sha256=mqak--H7D_b7o8JNQlQRmov2An-defyBGRJNhMNchXQ,1437
|
6
|
+
agentstr/models.py,sha256=McjwsZ3QjPcWqmSVbmE27K4ioNqJCnGL4te-xTkQbNM,11800
|
7
|
+
agentstr/models.pyi,sha256=X5StbTxpGklTVGNwhaDkC8vwoXMlpR7uSDvnsiiS1vU,2983
|
8
|
+
agentstr/nostr.py,sha256=1cgyFihvBj_280U3Mb67iKd1Q6RhU0aJ1ChUnAkrmfw,25337
|
9
|
+
agentstr/nostr.pyi,sha256=PNPYJcqBfVKsJd_TseK6H_Kzl_Gj71BE-Qrpp8kzcCQ,3499
|
10
|
+
agentstr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
+
agentstr-0.1.16.dist-info/LICENSE,sha256=20H0yoEDN5XO1xPXyZCyJjvSTP0YiarRMKWPfiaBhQY,1063
|
12
|
+
agentstr-0.1.16.dist-info/METADATA,sha256=uWtz9Zj9L68yJaeCQzjiG78JQe6ymAYIHsw_4D17uDA,4419
|
13
|
+
agentstr-0.1.16.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
14
|
+
agentstr-0.1.16.dist-info/top_level.txt,sha256=KZObFRHppZvKUGYB_m9w5HhLwps7jj7w6Xrw73dH2ss,9
|
15
|
+
agentstr-0.1.16.dist-info/RECORD,,
|
agentstr-0.1.14.dist-info/RECORD
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
agentstr/__init__.py,sha256=rbFtFOldBSbeDX_8Xva3YHRC9c3nPFA9mJXS3UZhJ4s,1294
|
2
|
-
agentstr/buyer.py,sha256=I1tApMjlq0Bg5Qk7twcAbF2rf_L5I2L9qzQO5sKv2RE,9912
|
3
|
-
agentstr/buyer.pyi,sha256=AqdKa7nQWohxHaoKHjCNpOpDB6rsWGWAlASNhwEw45g,1219
|
4
|
-
agentstr/merchant.py,sha256=3Fz4hrxyb5m7Kk47RodNC-Vyjm9iV7bI4ncPF8EMkhw,35078
|
5
|
-
agentstr/merchant.pyi,sha256=mqak--H7D_b7o8JNQlQRmov2An-defyBGRJNhMNchXQ,1437
|
6
|
-
agentstr/models.py,sha256=lEoopEQYIqI0egVxoXhBLlBh35C0WQmR_oBKm5Sexwk,11423
|
7
|
-
agentstr/models.pyi,sha256=k1_D-afE17gybHhtQMqA6cx7H5lYh7Fg0gbXclxyP4A,2857
|
8
|
-
agentstr/nostr.py,sha256=u2jDwQDmg01UCThDy1WW9lOPvAHyI1WMbtxFFi_2q08,22703
|
9
|
-
agentstr/nostr.pyi,sha256=nlBdOOI6vPboACjBvrQZKHy3BtCjboaClG9ZVD2X8XQ,3118
|
10
|
-
agentstr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
|
-
agentstr-0.1.14.dist-info/LICENSE,sha256=20H0yoEDN5XO1xPXyZCyJjvSTP0YiarRMKWPfiaBhQY,1063
|
12
|
-
agentstr-0.1.14.dist-info/METADATA,sha256=FV-_lJhW2H7K66AinZpTUB0o_kIjh0mBXS0Y7khKtkE,4667
|
13
|
-
agentstr-0.1.14.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
14
|
-
agentstr-0.1.14.dist-info/top_level.txt,sha256=KZObFRHppZvKUGYB_m9w5HhLwps7jj7w6Xrw73dH2ss,9
|
15
|
-
agentstr-0.1.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|