mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-03-17 21:31:52 +01:00
remove add relay with opts function
This commit is contained in:
parent
209c8947a6
commit
0ab6e01897
@ -93,8 +93,7 @@ class AdvancedSearch(DVMTaskInterface):
|
||||
signer = NostrSigner.keys(keys)
|
||||
cli = Client.with_opts(signer, opts)
|
||||
|
||||
ropts = RelayOptions().ping(False)
|
||||
await cli.add_relay_with_opts(options["relay"], ropts)
|
||||
await cli.add_relay(options["relay"])
|
||||
|
||||
await cli.connect()
|
||||
|
||||
|
@ -82,8 +82,7 @@ class DiscoverReports(DVMTaskInterface):
|
||||
for relay in self.dvm_config.RELAY_LIST:
|
||||
await cli.add_relay(relay)
|
||||
# add nostr band, too.
|
||||
ropts = RelayOptions().ping(False)
|
||||
await cli.add_relay_with_opts("wss://nostr.band", ropts)
|
||||
await cli.add_relay("wss://nostr.band")
|
||||
|
||||
await cli.connect()
|
||||
|
||||
|
@ -84,7 +84,7 @@ class DiscoverInactiveFollows(DVMTaskInterface):
|
||||
for relay in self.dvm_config.RELAY_LIST:
|
||||
await cli.add_relay(relay)
|
||||
ropts = RelayOptions().ping(False)
|
||||
await cli.add_relay_with_opts("wss://nostr.band", ropts)
|
||||
await cli.add_relay("wss://nostr.band")
|
||||
|
||||
await cli.connect()
|
||||
|
||||
|
@ -73,7 +73,7 @@ class DiscoverNonFollowers(DVMTaskInterface):
|
||||
await cli.add_relay(relay)
|
||||
#add nostr band, too.
|
||||
ropts = RelayOptions().ping(False)
|
||||
await cli.add_relay_with_opts("wss://nostr.band", ropts)
|
||||
await cli.add_relay("wss://nostr.band")
|
||||
|
||||
await cli.connect()
|
||||
|
||||
|
@ -77,8 +77,7 @@ class TrendingNotesGleasonator(DVMTaskInterface):
|
||||
signer = NostrSigner.keys(keys)
|
||||
cli = Client.with_opts(signer, opts)
|
||||
|
||||
ropts = RelayOptions().ping(False)
|
||||
await cli.add_relay_with_opts(options["relay"], ropts)
|
||||
await cli.add_relay(options["relay"])
|
||||
await cli.connect()
|
||||
|
||||
ltags = ["#e", "pub.ditto.trends"]
|
||||
|
@ -21,8 +21,7 @@ async def main():
|
||||
signer = NostrSigner.keys(keys)
|
||||
cli = Client.with_opts(signer, opts)
|
||||
|
||||
ropts = RelayOptions().ping(False)
|
||||
await cli.add_relay_with_opts(options["relay"], ropts)
|
||||
await cli.add_relay(options["relay"])
|
||||
await cli.connect()
|
||||
|
||||
ltags = ["#e", "pub.ditto.trends"]
|
||||
|
@ -43,7 +43,8 @@ def playground(announce=False):
|
||||
nip89config.CONTENT = json.dumps(nip89info)
|
||||
|
||||
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,
|
||||
@ -55,8 +56,7 @@ def playground(announce=False):
|
||||
from duck_chat import DuckChat
|
||||
options = dvm.set_options(request_form)
|
||||
async with DuckChat(model=ModelType.GPT4o) as chat:
|
||||
system_prompt= "You are a Bitcoiner.."
|
||||
query = ("{System}: " + system_prompt +" {User}: "+ options["input"])
|
||||
query = ("{role: system, content: " + options["system_prompt"] + "}" +" {role: user: content:" + options["input"]+ "}")
|
||||
result = await chat.ask_question(query)
|
||||
print(result)
|
||||
return result
|
||||
|
@ -141,8 +141,7 @@ async def nostr_client_test_inactive_filter(user):
|
||||
client = Client(signer)
|
||||
for relay in relay_list:
|
||||
await client.add_relay(relay)
|
||||
ropts = RelayOptions().ping(False)
|
||||
await client.add_relay_with_opts("wss://nostr.band", ropts)
|
||||
await client.add_relay("wss://nostr.band")
|
||||
await client.connect()
|
||||
config = DVMConfig
|
||||
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:
|
||||
await client.add_relay(relay)
|
||||
ropts = RelayOptions().ping(False)
|
||||
await client.add_relay_with_opts("wss://nostr.band", ropts)
|
||||
await client.add_relay("wss://nostr.band")
|
||||
await client.connect()
|
||||
config = DVMConfig
|
||||
await send_event(event, client=client, dvm_config=config)
|
||||
|
Loading…
x
Reference in New Issue
Block a user