AI conversation integrations - string too long

At a loss with this one, nothing leaps out of many google searches.

I am trying to setup HA Assist with an AI conversation agent but receive an error complaining about a string being too long. I have tried with Anthropic Claude, Google Generative AI and OpenAI ChatGPT. All return similar errors, see below.

Anthropic Claude

Sorry, I had a problem talking to Anthropic: Error code: 400 - {‘type’: ‘error’, ‘error’: {‘type’: ‘invalid_request_error’, ‘message’: ‘tools.34.custom.name: String should have at most 64 characters’}}

Google Generative AI

Sorry, I had a problem talking to Google Generative AI: 400 * GenerateContentRequest.tools[0].function_declarations[34].name: Invalid function name. Must start with a letter or an underscore. Must be alphameric (a-z, A-Z, 0-9), underscores (_), dots (.) or dashes (-), with a maximum length of 64.

OpenAI ChatGPT

Error talking to OpenAI: Error code: 400 - {‘error’: {‘message’: “Invalid ‘tools[34].function.name’: string too long. Expected a string with maximum length 64, but got a string with length 71 instead.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘tools[34].function.name’, ‘code’: ‘string_above_max_length’}}

I am guessing that as I have a similar error from each that the cause is something I have wrong in HA but I have no idea what that might be. Each integration has been setup by accepting the defaults so I am not trying to do anything special with prompts as yet.

Assist works correctly if I set the conversation agent as Home Assistant.

Any suggestions would be gratefully received. :slightly_smiling_face:

This says likely, one of your scripts or intent scripts or something has a very long name and or invalid characters

Hey @NathanCu thanks for the reply. I’m not using any scripts or intent scripts in relation to Assist, or at least I don’t think I am! I just added the AI integrations accepted their defaults and changed the conversation agent to point to each in turn.

Doesnt have to be.

The way I read that it enumerated tools. And got to number 34 (prob 35 base 0) it blew up so that could be 35 scripts of any type. Look for things with extra long names or weird characters… If it’s not that you’ll probably be opening a ticket on github.