mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-10-10 17:32:39 +02:00
remove add relay with opts function
This commit is contained in:
@@ -93,8 +93,7 @@ class AdvancedSearch(DVMTaskInterface):
|
|||||||
signer = NostrSigner.keys(keys)
|
signer = NostrSigner.keys(keys)
|
||||||
cli = Client.with_opts(signer, opts)
|
cli = Client.with_opts(signer, opts)
|
||||||
|
|
||||||
ropts = RelayOptions().ping(False)
|
await cli.add_relay(options["relay"])
|
||||||
await cli.add_relay_with_opts(options["relay"], ropts)
|
|
||||||
|
|
||||||
await cli.connect()
|
await cli.connect()
|
||||||
|
|
||||||
|
@@ -82,8 +82,7 @@ class DiscoverReports(DVMTaskInterface):
|
|||||||
for relay in self.dvm_config.RELAY_LIST:
|
for relay in self.dvm_config.RELAY_LIST:
|
||||||
await cli.add_relay(relay)
|
await cli.add_relay(relay)
|
||||||
# add nostr band, too.
|
# add nostr band, too.
|
||||||
ropts = RelayOptions().ping(False)
|
await cli.add_relay("wss://nostr.band")
|
||||||
await cli.add_relay_with_opts("wss://nostr.band", ropts)
|
|
||||||
|
|
||||||
await cli.connect()
|
await cli.connect()
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ class DiscoverInactiveFollows(DVMTaskInterface):
|
|||||||
for relay in self.dvm_config.RELAY_LIST:
|
for relay in self.dvm_config.RELAY_LIST:
|
||||||
await cli.add_relay(relay)
|
await cli.add_relay(relay)
|
||||||
ropts = RelayOptions().ping(False)
|
ropts = RelayOptions().ping(False)
|
||||||
await cli.add_relay_with_opts("wss://nostr.band", ropts)
|
await cli.add_relay("wss://nostr.band")
|
||||||
|
|
||||||
await cli.connect()
|
await cli.connect()
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ class DiscoverNonFollowers(DVMTaskInterface):
|
|||||||
await cli.add_relay(relay)
|
await cli.add_relay(relay)
|
||||||
#add nostr band, too.
|
#add nostr band, too.
|
||||||
ropts = RelayOptions().ping(False)
|
ropts = RelayOptions().ping(False)
|
||||||
await cli.add_relay_with_opts("wss://nostr.band", ropts)
|
await cli.add_relay("wss://nostr.band")
|
||||||
|
|
||||||
await cli.connect()
|
await cli.connect()
|
||||||
|
|
||||||
|
@@ -77,8 +77,7 @@ class TrendingNotesGleasonator(DVMTaskInterface):
|
|||||||
signer = NostrSigner.keys(keys)
|
signer = NostrSigner.keys(keys)
|
||||||
cli = Client.with_opts(signer, opts)
|
cli = Client.with_opts(signer, opts)
|
||||||
|
|
||||||
ropts = RelayOptions().ping(False)
|
await cli.add_relay(options["relay"])
|
||||||
await cli.add_relay_with_opts(options["relay"], ropts)
|
|
||||||
await cli.connect()
|
await cli.connect()
|
||||||
|
|
||||||
ltags = ["#e", "pub.ditto.trends"]
|
ltags = ["#e", "pub.ditto.trends"]
|
||||||
|
@@ -21,8 +21,7 @@ async def main():
|
|||||||
signer = NostrSigner.keys(keys)
|
signer = NostrSigner.keys(keys)
|
||||||
cli = Client.with_opts(signer, opts)
|
cli = Client.with_opts(signer, opts)
|
||||||
|
|
||||||
ropts = RelayOptions().ping(False)
|
await cli.add_relay(options["relay"])
|
||||||
await cli.add_relay_with_opts(options["relay"], ropts)
|
|
||||||
await cli.connect()
|
await cli.connect()
|
||||||
|
|
||||||
ltags = ["#e", "pub.ditto.trends"]
|
ltags = ["#e", "pub.ditto.trends"]
|
||||||
|
@@ -43,7 +43,8 @@ def playground(announce=False):
|
|||||||
nip89config.CONTENT = json.dumps(nip89info)
|
nip89config.CONTENT = json.dumps(nip89info)
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
"input": "How do you call a noisy ostrich?",
|
"system_prompt": "You are a funny purple ostrich. Reply in a funny way.",
|
||||||
|
"input": "",
|
||||||
}
|
}
|
||||||
|
|
||||||
dvm = GenericDVM(name=name, dvm_config=dvm_config, nip89config=nip89config,
|
dvm = GenericDVM(name=name, dvm_config=dvm_config, nip89config=nip89config,
|
||||||
@@ -55,8 +56,7 @@ def playground(announce=False):
|
|||||||
from duck_chat import DuckChat
|
from duck_chat import DuckChat
|
||||||
options = dvm.set_options(request_form)
|
options = dvm.set_options(request_form)
|
||||||
async with DuckChat(model=ModelType.GPT4o) as chat:
|
async with DuckChat(model=ModelType.GPT4o) as chat:
|
||||||
system_prompt= "You are a Bitcoiner.."
|
query = ("{role: system, content: " + options["system_prompt"] + "}" +" {role: user: content:" + options["input"]+ "}")
|
||||||
query = ("{System}: " + system_prompt +" {User}: "+ options["input"])
|
|
||||||
result = await chat.ask_question(query)
|
result = await chat.ask_question(query)
|
||||||
print(result)
|
print(result)
|
||||||
return result
|
return result
|
||||||
|
@@ -141,8 +141,7 @@ async def nostr_client_test_inactive_filter(user):
|
|||||||
client = Client(signer)
|
client = Client(signer)
|
||||||
for relay in relay_list:
|
for relay in relay_list:
|
||||||
await client.add_relay(relay)
|
await client.add_relay(relay)
|
||||||
ropts = RelayOptions().ping(False)
|
await client.add_relay("wss://nostr.band")
|
||||||
await client.add_relay_with_opts("wss://nostr.band", ropts)
|
|
||||||
await client.connect()
|
await client.connect()
|
||||||
config = DVMConfig
|
config = DVMConfig
|
||||||
await send_event(event, client=client, dvm_config=config)
|
await send_event(event, client=client, dvm_config=config)
|
||||||
@@ -196,7 +195,7 @@ async def nostr_client_test_discovery(user, ptag):
|
|||||||
for relay in relay_list:
|
for relay in relay_list:
|
||||||
await client.add_relay(relay)
|
await client.add_relay(relay)
|
||||||
ropts = RelayOptions().ping(False)
|
ropts = RelayOptions().ping(False)
|
||||||
await client.add_relay_with_opts("wss://nostr.band", ropts)
|
await client.add_relay("wss://nostr.band")
|
||||||
await client.connect()
|
await client.connect()
|
||||||
config = DVMConfig
|
config = DVMConfig
|
||||||
await send_event(event, client=client, dvm_config=config)
|
await send_event(event, client=client, dvm_config=config)
|
||||||
|
Reference in New Issue
Block a user