extended_openai_conversation icon indicating copy to clipboard operation
extended_openai_conversation copied to clipboard

user name (or function) with spaces fails

Open danielp370 opened this issue 11 months ago • 1 comments

OpenAI does checks function parameters for ^[a-zA-Z0-9_-]{1,64}$. Unfortunately some integrations have spaces in their names. For examples, the Voice Over IP integration that can be used to talk directly to a HA Voice Assist via voip phones.

Error code: 400 - {'error': {'message': "'Voice over IP' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'messages.1.name'", 'type': 'invalid_request_error', 'param': None, 'code': None}}

I have a patch https://github.com/jekalmin/extended_openai_conversation/pull/165 Validated that this fixes the issue and VoIP works nicely.

danielp370 avatar Mar 05 '24 00:03 danielp370

Thanks for reporting an issue.

As I commented in your PR, I was still concerning what to use in user's field because it has an issue when friendly_name is not in English (see https://github.com/jekalmin/extended_openai_conversation/issues/63).

Probably using user_id(state_attr('person.xxx', 'user_id') is a reasonable option.

jekalmin avatar Mar 09 '24 07:03 jekalmin

Closing the issue.

jekalmin avatar Jan 31 '25 17:01 jekalmin