mirror of
https://github.com/aljazceru/nostrdvm.git
synced 2026-01-06 15:54:18 +01:00
future: rework functions to async to be compatible with newest nostrsdk
This commit is contained in:
@@ -29,13 +29,10 @@ class SpeechToTextGoogle(DVMTaskInterface):
|
||||
dependencies = [("nostr-dvm", "nostr-dvm"),
|
||||
("speech_recognition", "SpeechRecognition==3.10.0")]
|
||||
|
||||
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)
|
||||
if options is None:
|
||||
self.options = {}
|
||||
|
||||
|
||||
def is_input_supported(self, tags, client=None, dvm_config=None):
|
||||
for tag in tags:
|
||||
@@ -106,7 +103,7 @@ class SpeechToTextGoogle(DVMTaskInterface):
|
||||
request_form['options'] = json.dumps(options)
|
||||
return request_form
|
||||
|
||||
def process(self, request_form):
|
||||
async def process(self, request_form):
|
||||
import speech_recognition as sr
|
||||
if self.options.get("api_key"):
|
||||
api_key = self.options['api_key']
|
||||
|
||||
Reference in New Issue
Block a user