Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 400 with OpenAI Integration in Home Assistant #119015

Closed
tomtom123123 opened this issue Jun 6, 2024 · 8 comments · Fixed by #119144
Closed

Error 400 with OpenAI Integration in Home Assistant #119015

tomtom123123 opened this issue Jun 6, 2024 · 8 comments · Fixed by #119144

Comments

@tomtom123123
Copy link

The problem

I am experiencing an issue with the OpenAI integration in Home Assistant. When I try to use the Assist feature, I receive the following error:

Sorry, I had a problem talking to OpenAI: Error code: 400 - {'error': {'message': "Invalid 'tools[7].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.", 'type': 'invalid_request_error', 'param': 'tools[7].function.name', 'code': 'invalid_value'}}

Steps to Reproduce:

Set up the OpenAI integration in Home Assistant following the official documentation.
Configure the integration with the necessary parameters.
Attempt to use the Assist feature.

What version of Home Assistant Core has the issue?

core-2024.6.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Open Ai Conversation

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jun 6, 2024

Hey there @balloob, mind taking a look at this issue as it has been labeled with an integration (openai_conversation) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of openai_conversation can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign openai_conversation Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


openai_conversation documentation
openai_conversation source
(message by IssueLinks)

@DJBenson
Copy link

DJBenson commented Jun 7, 2024

I'm getting a very similar message but a different array index;

Sorry, I had a problem talking to OpenAI: Error code: 400 - {'error': {'message': "Invalid 'tools[3].function.name': string does not match pattern. Expected a string that matches the pattern '^[a-zA-Z0-9_-]+$'.", 'type': 'invalid_request_error', 'param': 'tools[3].function.name', 'code': 'invalid_value'}}

@balloob
Copy link
Member

balloob commented Jun 8, 2024

Do you have any custom intents registered?

@DJBenson
Copy link

DJBenson commented Jun 8, 2024

Do you have any custom intents registered?

I did, now I don't and it works - thank you.

@balloob
Copy link
Member

balloob commented Jun 8, 2024

So you can have custom intents registered but you need to not use spaces or special or non Latin characters

@jnuha

This comment was marked as off-topic.

@jnuha

This comment was marked as off-topic.

@DJBenson

This comment was marked as off-topic.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants