diff --git a/nostr_dvm/tasks/advanced_search.py b/nostr_dvm/tasks/advanced_search.py index 54be0ba..42d3176 100644 --- a/nostr_dvm/tasks/advanced_search.py +++ b/nostr_dvm/tasks/advanced_search.py @@ -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() diff --git a/nostr_dvm/tasks/discovery_censor_wot.py b/nostr_dvm/tasks/discovery_censor_wot.py index 53af3b0..e00ca89 100644 --- a/nostr_dvm/tasks/discovery_censor_wot.py +++ b/nostr_dvm/tasks/discovery_censor_wot.py @@ -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() diff --git a/nostr_dvm/tasks/discovery_inactive_follows.py b/nostr_dvm/tasks/discovery_inactive_follows.py index 8ada462..5983375 100644 --- a/nostr_dvm/tasks/discovery_inactive_follows.py +++ b/nostr_dvm/tasks/discovery_inactive_follows.py @@ -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() diff --git a/nostr_dvm/tasks/discovery_nonfollowers.py b/nostr_dvm/tasks/discovery_nonfollowers.py index 242af3b..3702154 100644 --- a/nostr_dvm/tasks/discovery_nonfollowers.py +++ b/nostr_dvm/tasks/discovery_nonfollowers.py @@ -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() diff --git a/nostr_dvm/tasks/discovery_trending_notes_gleasonator.py b/nostr_dvm/tasks/discovery_trending_notes_gleasonator.py index 8c6d566..5351a73 100644 --- a/nostr_dvm/tasks/discovery_trending_notes_gleasonator.py +++ b/nostr_dvm/tasks/discovery_trending_notes_gleasonator.py @@ -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"] diff --git a/tests/ditto.py b/tests/ditto.py index 9a5a1db..351d584 100644 --- a/tests/ditto.py +++ b/tests/ditto.py @@ -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"] diff --git a/tests/generic_dvm_duck_chat.py b/tests/generic_dvm_duck_chat.py index 1429c48..0c6492d 100644 --- a/tests/generic_dvm_duck_chat.py +++ b/tests/generic_dvm_duck_chat.py @@ -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 diff --git a/tests/test_dvm_client.py b/tests/test_dvm_client.py index 69875fc..0ded45b 100644 --- a/tests/test_dvm_client.py +++ b/tests/test_dvm_client.py @@ -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)