-
Notifications
You must be signed in to change notification settings - Fork 38
provide a way to customize JsonSchemaUtil #159
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
Comments
Hi @asafbennatan thanks for using simple-openai! As far as I know, OpenAI is not expecting any "additionalProperties" field in the function's structure. I'm afraid I'm not following you, could you elaborate more here and explain what you are trying to do, please? |
Hi @sashirestela , thanks for creating this library. i wanted that when a Map is encountered we will add the missing properties:{} to it. (same as i see that is being done to the top level object).
for reference here is an example of my use case :
the desired output is :
currently it will output:
there might be a better way to achieve this but in general i assume there can be other use cases which require the customization of the schema generation process . my suggestion is to have the users of the library to optionally provide custom schema generation logic via some interface. |
I'm not sure if OpenAI is going to work with this "dynamic structure", but I'm curious about it. You will need to provide some running mechanism or extend the FunctionExecutor too. I could have a better understanding of your requirement in code, so you could create a PR. |
this is working already, let me work on a PR |
hi @sashirestela , this is done - please check pr #160 |
@asafbennatan This was deployed as part of the 3.6.0 release. Thanks for your contribution. If you find this project valuable there are a few ways you can show us your love, preferably all of them 🙂:
|
currently i dont see a way to customize the outputted schema that will be used for functions .
specifically i need a way to output additionalProperties=true for some type.
any suggestion?
would a PR be accepted here ?
additionally i suspect that setting Option.MAP_VALUES_AS_ADDITIONAL_PROPERTIES by default would be reasonable , if this is done then i wont need a customization for the JsonSchemaUtil at all but i suspect this is a broader issue than that
The text was updated successfully, but these errors were encountered: