Is there a way to add in a script that will run on responses from ollama in the voice assistant pipeline that will strip unwanted characters? I have been getting asterisk characters returned on responses that are then read by piper. I have tried adding instructions in my prompt to not include markdown or special characters but this has not worked.
#Strip asterisk characters from ollama responses before sending to piper
1 messages · Page 1 of 1 (latest)
Try to add to your system prompt something like "Use plain text in your responses, prepare text for text-to-speech. Don't use markup symbols."
didn't the latest version of piper have something in it to strip them? I remember seeing it on the changelog but i haven't looked into it extensively.
but as formatBCE said, adding stuff to the prompt can also work around the issue. i have these lines in mine.
Deliver all responses in plain text only without any formatting or special characters.
you MUST not use asterisk's in responses.
sometimes they have crept in but for the most part it keeps them out.
I tried several versions of adding this to the prompt. It seems to help a bit sometimes but it's not reliable. I still get asterisks.
I am not running piper directly on home assistant. I am running it on a separate Ubuntu machine that also runs whisper. I can try installing it locally again to see if it has an option for that or check to see if the version I have supports that but haven't seen any indication that it does. I've considered that since it's running externally, it might make it easier to add filtering.
gotcha, i run whisper externally but not piper
Can you take a Quick Look at yours and see if there's a filter option?
i think its transparent
Remove asterisks at the start of a line (markdown list)
i sent **this is a test** at it and got no "asterisk asterisk"
So not a setting. New version should just do it.
yeah
Just tried installing the local version and it install and looks like it's running properly according to the logs. It does not auto discover like it originally did when I first set up home assistant. I also tried adding it manually but it's not clear what the url should be for that. Keep finding conflicting information about that.
do you have the terminal addon?
Eventually found the correct url so didn't have to use auto discover.
first ensure the addon is actually running and can try restarting home assistant.
however if you need the containers ip to add manually then on the terminal you could use:
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' addon_core_piper
will give you the internal ip of the container running the piper addon
nice, now to see if it works 🙂
Yeah. I have a retro looking candlestick phone connected. It's set up to tell ghost stories or play a murder mystery game.
that's awesome
Thanks for the help. This appears to be working. I have it set up to randomly select background music which is played on a homepod in the same room while the phone is used to either tell a ghost story or play the murder mystery game.
While the upgrade to piper has helped, I have noticed that there is a case where the filtering does not work. If the asterisks are preceded by a colon, they are not filtered. I had a few occurrences of this. Asterisks were pronounced but it wasn't valid markdown because the leading ones were removed. So this: became this:** for example.
ah that's a pain, ill leave my prompt stuff in for now at least then