Who can explain to me how to create a personal converter as shown in the documentation
as indicated :
You can define your own converters by placing a file in the
converters
directory of your profile. Like slot programs, this file should contain a shebang and be marked as executable (chmod +x
). A file namedconverters/foo/bar
should be referenced as!foo/bar
insentences.ini
.
I reproduced the example given: created a file … / profiles / fr / converters / conv_jj
#!/usr/bin/env python3
import sys
import json
value = json.load(sys.stdin)
print(int(value))
gave him performing rights (chmod +x
)
and I added an intent such as:
[testconv]
test (val):1 { value!conv_jj }
and I get an error -> NluException: “conv_jj”
the log
[ERROR:2021-01-12 14:42:16,241] rhasspynlu_hermes: handle_query
Traceback (most recent call last):
File “/home/pi/rhasspy/rhasspy-nlu-hermes/rhasspynlu_hermes/init.py”, line 104, in handle_query
fuzzy=self.fuzzy,
File “/home/pi/rhasspy/rhasspy-nlu/rhasspynlu/fsticuffs.py”, line 70, in recognize
extra_converters=extra_converters,
File “/home/pi/rhasspy/rhasspy-nlu/rhasspynlu/fsticuffs.py”, line 565, in path_to_recognition
converter_func = converters[last_converter.name]
KeyError: ‘convjj’
[DEBUG:2021-01-12 14:42:16,243] rhasspynlu_hermes: -> NluError(error="‘convjj’", site_id=‘Master’, context=‘voir test’, session_id=‘6634137f-dafc-4a02-957e-769ef555bbb4’)
[DEBUG:2021-01-12 14:42:16,244] rhasspynlu_hermes: Publishing 118 bytes(s) to hermes/error/nlu
[DEBUG:2021-01-12 14:42:16,248] rhasspyserver_hermes: Handling NluError (topic=hermes/error/nlu, id=1efac65f-f07e-4197-bdc3-b14527e88048)
[ERROR:2021-01-12 14:42:16,250] rhasspyserver_hermes: NluError(error="‘convjj’", site_id=‘Master’, context=‘voir test’, session_id=‘6634137f-dafc-4a02-957e-769ef555bbb4’)
[DEBUG:2021-01-12 14:42:16,253] rhasspyserver_hermes: -> HandleToggleOn(site_id=‘Master’)
[DEBUG:2021-01-12 14:42:16,254] rhasspyserver_hermes: Publishing 20 bytes(s) to rhasspy/handle/toggleOn
[ERROR:2021-01-12 14:42:16,255] rhasspyserver_hermes: ‘convjj’
Traceback (most recent call last):
File “/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1821, in full_dispatch_request
result = await self.dispatch_request(request_context)
File “/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/app.py”, line 1869, in dispatch_request
return await handler(**request_.view_args)
File “/home/pi/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py”, line 1416, in api_text_to_intent
user_entities=user_entities,
File “/home/pi/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/main.py”, line 2641, in text_to_intent_dict
result = await core.recognize_intent(text, intent_filter=intent_filter)
File “/home/pi/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/init.py”, line 524, in recognize_intent
raise NluException(result.error)
rhasspyserver_hermes.NluException: ‘convjj’
am I the one who did not understand how to do it? or is it a bug?
thank you in advance for your help
Arpagor