jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

user name (or function) with spaces fails

danielp370 opened this issue · 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 #165
Validated that this fixes the issue and VoIP works nicely.

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 #63).

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