#Strip asterisk characters from ollama responses before sending to piper

1 messages · Page 1 of 1 (latest)

tender geyser
#

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.

tight fossil
#

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."

waxen grail
# tender geyser Is there a way to add in a script that will run on responses from ollama in the ...

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.

tender geyser
#

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.

tender geyser
waxen grail
tender geyser
waxen grail
#

Remove asterisks at the start of a line (markdown list)

#

i sent **this is a test** at it and got no "asterisk asterisk"

tender geyser
#

So not a setting. New version should just do it.

waxen grail
#

yeah

tender geyser
# waxen grail 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.

waxen grail
tender geyser
#

Eventually found the correct url so didn't have to use auto discover.

waxen grail
#

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

waxen grail
tender geyser
#

Yeah. I have a retro looking candlestick phone connected. It's set up to tell ghost stories or play a murder mystery game.

tender geyser
# waxen grail 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.

tender geyser
waxen grail