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

call to GPT4 returns error code 400 #18

Open
bogorad opened this issue Nov 18, 2023 · 4 comments
Open

call to GPT4 returns error code 400 #18

bogorad opened this issue Nov 18, 2023 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@bogorad
Copy link

bogorad commented Nov 18, 2023

{
   "error":{
      "message":"None is not of type 'array' - 'functions'",
      "type":"invalid_request_error",
      "param":null,
      "code":null
   }
}

The same call with turbo works just fine.

@theskyisthelimit
Copy link

theskyisthelimit commented Jan 5, 2024

I've updated the plugin yesterday and now I'm also getting the error. before, the same flow worked fine.

{"error":{"message":"Invalid value for 'function_call': 'function_call' is only allowed when 'functions' are specified.","type":"invalid_request_error","param":"function_call","code":null}}

@HaroldPetersInskipp
Copy link
Owner

HaroldPetersInskipp commented Jan 13, 2024

It looks like "functions" and "function_call" are deprecated in favor of "tools" and "tool_choice" in the documentation here https://platform.openai.com/docs/api-reference/chat/create.

I no longer have API access so I'm kind of flying blind here, but perhaps changing the line in chatgpt.js from:

functions: msg.functions || null,

to

functions: msg.functions || [],

may resolve the issue.

Sorry I can't be of more help at this time.

If anyone could confirm or deny if that works, I would be grateful, otherwise I will have to revert the feature soon.

@HaroldPetersInskipp HaroldPetersInskipp added the help wanted Extra attention is needed label Jan 13, 2024
@kuges
Copy link

kuges commented Jan 16, 2024

I made the change as suggested but now get the error:

[] is too short - 'functions'

@HaroldPetersInskipp
Copy link
Owner

Feature has been reverted for now, let me know if any issues persist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants