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

ModifyMessage failed with error code 400, message: Unknown parameter #692

Closed
Ahmadhegavf opened this issue Mar 24, 2024 · 1 comment · Fixed by #699
Closed

ModifyMessage failed with error code 400, message: Unknown parameter #692

Ahmadhegavf opened this issue Mar 24, 2024 · 1 comment · Fixed by #699
Labels
bug Something isn't working

Comments

@Ahmadhegavf
Copy link

Bug Description:
The ModifyMessage function from the go-openai library expects a parameter metadata of type map[string]any, but the API it interfaces with, specifically the Modify Message endpoint, requires the metadata to be wrapped in a JSON object with a field named "metadata". This discrepancy causes the API call to fail due to an unknown parameter.

To Reproduce:
Call the ModifyMessage function with a non-empty metadata parameter.

Expected Behavior:
The method should serialize the metadata into a JSON object with a field named "metadata" and send it to the API, aligning with the API's expectations.

Environment:

  • go-openai version: v1.120.3
  • Go version: go1.21.3
  • OpenAI API version: v1
  • OS: Ubuntu 20.04
@Ahmadhegavf Ahmadhegavf added the bug Something isn't working label Mar 24, 2024
@qhenkart
Copy link
Contributor

I just ran into this as well and you was going to make an issue. I can confirm this report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants