-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Function Call Error Due to Nil Properties #429
Labels
bug
Something isn't working
Comments
This was referenced Jul 8, 2023
Fixed #431 |
The problem recurs when Parameters is a value instead of a pointer. |
vvatanabe
added a commit
to vvatanabe/go-openai
that referenced
this issue
Jul 10, 2023
vvatanabe
added a commit
to vvatanabe/go-openai
that referenced
this issue
Jul 10, 2023
vvatanabe
added a commit
to vvatanabe/go-openai
that referenced
this issue
Jul 11, 2023
Fixed #434 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
An error occurs when using the Function Call feature. The relevant error message is as follows:
This issue arises when the map in the Properties field of jsonschema.Definition is set to nil.
To Reproduce
This bug can be reproduced through the following steps:
Please note that the process works correctly if the map in the Properties field of jsonschema.Definition is initialized.
PR for reproduction:
#430
Expected behavior
Even if the map in the Properties field of jsonschema.Definition is nil, it should be possible to send a request using the Function Call feature.
Environment
go-openai version: v1.13.0
Additional context
This bug was caused by changes made in pull request #419. Specifically, omitempty was removed from the Properties field of jsonschema.Definition by pull request #419. This change caused issues when the map in the Properties field was set to nil.
For detailed reasons why omitempty was removed, please refer to the description in pull request #419.
As a bug handling measure, it seems better to initialize the map in the Properties field of jsonschema.Definition to an empty map if it is set to nil. Also, since jsonschema.Definition has a recursive structure that can have jsonschema.Definition as a child, the check for nil and initialization should also be done recursively.
The text was updated successfully, but these errors were encountered: