Question about custom converters

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 named converters/foo/bar should be referenced as !foo/bar in sentences.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)

gave him performing rights (chmod +x )

and I added an intent such as:

test (val):1 { value!conv_jj }

and I get an error -> NluException: “conv_jj”
the log :slight_smile:

[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/”, line 104, in handle_query
File “/home/pi/rhasspy/rhasspy-nlu/rhasspynlu/”, line 70, in recognize
File “/home/pi/rhasspy/rhasspy-nlu/rhasspynlu/”, line 565, in path_to_recognition
converter_func = converters[]
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/”, line 1821, in full_dispatch_request
result = await self.dispatch_request(request_context)
File “/home/pi/rhasspy/.venv/lib/python3.7/site-packages/quart/”, line 1869, in dispatch_request
return await handler(**request_.view_args)
File “/home/pi/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/”, line 1416, in api_text_to_intent
File “/home/pi/rhasspy/rhasspy-server-hermes/rhasspyserver_hermes/”, 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/”, 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

Sorry, misread.

Why doe have value!conv_jj? and not !conv_jj?

Wow, I guess these have broken for quite a while. Thanks for catching this! I’ve fixed them for fsticuffs and fuzzywuzzy, so I’ll roll this into the 2.5.9 update :+1:

Romkaboter I did not understand your answer correctly:
"Why doe have value!conv_jj? and not !conv_jj?

the test is ok for : (value!int) but not for (value!conv_jj)
int is internal converter
and the problem is for custom converter only -> conv_jj

thank’s synesthesiam but i prefer to use the venv version … not docker

That’s fine. It’s up on Github now if you want to update.