mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-11-19 03:36:43 +01:00
future: rework functions to async to be compatible with newest nostrsdk
This commit is contained in:
@@ -25,11 +25,9 @@ class TextGenerationUnleashedChat(DVMTaskInterface):
|
||||
dependencies = [("nostr-dvm", "nostr-dvm"),
|
||||
("openai", "openai")]
|
||||
|
||||
def __init__(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
||||
admin_config: AdminConfig = None, options=None):
|
||||
async def init_dvm(self, name, dvm_config: DVMConfig, nip89config: NIP89Config, nip88config: NIP88Config = None,
|
||||
admin_config: AdminConfig = None, options=None):
|
||||
dvm_config.SCRIPT = os.path.abspath(__file__)
|
||||
super().__init__(name=name, dvm_config=dvm_config, nip89config=nip89config, nip88config=nip88config,
|
||||
admin_config=admin_config, options=options)
|
||||
|
||||
def is_input_supported(self, tags, client=None, dvm_config=None):
|
||||
for tag in tags:
|
||||
@@ -60,7 +58,7 @@ class TextGenerationUnleashedChat(DVMTaskInterface):
|
||||
|
||||
return request_form
|
||||
|
||||
def process(self, request_form):
|
||||
async def process(self, request_form):
|
||||
from openai import OpenAI
|
||||
temp_open_ai_api_key = os.environ["OPENAI_API_KEY"]
|
||||
os.environ["OPENAI_API_KEY"] = os.getenv("UNLEASHED_API_KEY")
|
||||
|
||||
Reference in New Issue
Block a user