mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-22 06:11:00 +02:00
Merge pull request #29 from dtdannen/main
added missing async func def for ollama and unleashed examples
This commit is contained in:
commit
2abbadf295
@ -61,7 +61,7 @@ async def nostr_client():
|
|||||||
|
|
||||||
#nostr_client_test_image_private("a beautiful ostrich watching the sunset")
|
#nostr_client_test_image_private("a beautiful ostrich watching the sunset")
|
||||||
class NotificationHandler(HandleNotification):
|
class NotificationHandler(HandleNotification):
|
||||||
def handle(self, relay_url, subscription_id, event: Event):
|
async def handle(self, relay_url, subscription_id, event: Event):
|
||||||
print(f"Received new event from {relay_url}: {event.as_json()}")
|
print(f"Received new event from {relay_url}: {event.as_json()}")
|
||||||
if event.kind() == 7000:
|
if event.kind() == 7000:
|
||||||
print("[Nostr Client]: " + event.as_json())
|
print("[Nostr Client]: " + event.as_json())
|
||||||
|
@ -66,7 +66,7 @@ async def nostr_client():
|
|||||||
|
|
||||||
|
|
||||||
class NotificationHandler(HandleNotification):
|
class NotificationHandler(HandleNotification):
|
||||||
def handle(self, relay_url, subscription_id, event: Event):
|
async def handle(self, relay_url, subscription_id, event: Event):
|
||||||
print(f"Received new event from {relay_url}: {event.as_json()}")
|
print(f"Received new event from {relay_url}: {event.as_json()}")
|
||||||
if event.kind() == 7000:
|
if event.kind() == 7000:
|
||||||
print("[Nostr Client]: " + event.as_json())
|
print("[Nostr Client]: " + event.as_json())
|
||||||
@ -83,7 +83,7 @@ async def nostr_client():
|
|||||||
print("[Nostr Client]: " + f"Received new zap:")
|
print("[Nostr Client]: " + f"Received new zap:")
|
||||||
print(event.as_json())
|
print(event.as_json())
|
||||||
|
|
||||||
def handle_msg(self, relay_url, msg):
|
async def handle_msg(self, relay_url, msg):
|
||||||
return
|
return
|
||||||
|
|
||||||
asyncio.create_task(client.handle_notifications(NotificationHandler()))
|
asyncio.create_task(client.handle_notifications(NotificationHandler()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user