"Error talking to OpenAI" with music assistant script

Hi all

I’ve got the VPE and music assistant running on my HA server. From the start it was working “ok” but only about 40% of my commands recognised and executed (play radio station, pause, etc) but the rest of the time would get all sorts of issues. Digging in to it I see there is a recommended script to expose to the voice assistant that should help. I used the blueprint from music assistant (as advised by them - GitHub - music-assistant/voice-support: Music Assistant blueprints) to make the script (following the guidance) but when I expose it to the conversation agent, nothing works. Every time I ask it anything, not even involving anything audio or speakers (e.g. what is 8 x 8) I get the response “Error talking to openai”. If I remove the exposed script, everything works again. I don’t understand how exposing a script can interfere with other commands not using anything similar to the title or description of the script.

Can anyone advise the cause or where I should start looking?

Thanks
Alan

That’s the generic panic error for oai.

What you described tends to indicate a problem in that script - there could be a few issues.

  1. did you edit the script (including the description)? If yes look at your edits. Especially large descriptions or non ascii characters.

  2. if you did not edit the script how. Many scripts and intents do you have? (you only get 128, 129 throws an error) you can test this by creating any simple script and exposing it. If you get the same issue you’re over the limit.

Thanks for the reply.
Is this because it doesn’t know what the script is supposed to do, and then fails when trying to decide on anything that needs to be done?

  1. I added the recommend description but I think I changed 1 minor thing. Can’t remember exactly now but will check. The description was pretty much what it was and still clear that it was for playing media, so can’t see why it would not understand. I will recopy the exact one provided and see if it helps.
  2. No, this is the first I’ve done. Got it running as-is and only started playing with it. I do have a lot of entities exposed to it. Would that cause an issue with limits?

Thanks

UPDATE: tried copying the exact description over and still get the same issue. The title of the script is obscure as working with my naming convention. Does that need to be more obvious (I am under the impression the description is what drives it)

If its only that script…

The description is limited to 1024 characters and they must all be ascii.

Error talking to oai means something fundamental errored when it was loading the tool descriptions and it blew up.it never made it that far.

I have that very same script loaded in my setup so the script itself unchanged is fine. If you changed anything when moving it into your system I’d start there.

Not sure what I did wrong originally. I ended up deleting the script and setting it up again. Worked fine then, even with using the same description and settings as the first time.
Thanks for helping

Random accidental character somewhere in the description somewhere most likely. I’ve done it. But now you see how fragile it is. You can absolutely hose your entire pipeline with one bad script.

So add, test, add, test so you don’t get yourself into a position where you’re 32 scripts in before you test and therefore don’t know what change hosed you.