This repository was archived by the owner on Oct 31, 2024. It is now read-only.
add description and required control#32
Open
adamskrodzki wants to merge 3 commits into
Open
Conversation
adamskrodzki
commented
Jun 27, 2023
| case 'number': | ||
| if (Number.isInteger(value)) { | ||
| return { type: ValueType.Integer }; | ||
| return description ? { type: ValueType.Integer, description } : { type: ValueType.Integer }; |
Author
There was a problem hiding this comment.
description should be added to schema only if description is not null.
adamskrodzki
commented
Jun 27, 2023
|
|
||
| if (!options?.noRequired) { | ||
| schema.required = keys; | ||
| if(obj["excludeFromRequired"]){ |
Author
There was a problem hiding this comment.
special, reserved function. Use to specify which properties should be excluded from the required of specific object schema. terurns array of names of properties that should not be included in required array
adamskrodzki
commented
Jun 27, 2023
| let description : string | undefined = undefined; | ||
|
|
||
| if(obj["addDescriptionOfProperty"]){ | ||
| description= obj["addDescriptionOfProperty"](key); |
Author
There was a problem hiding this comment.
special, reserved function. function takes property name and returns description or undefined
added 2 commits
June 27, 2023 22:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intention of this PR is to upgrade this library to be easier to use with OpenAI function calling
https://openai.com/blog/function-calling-and-other-api-updates
OpenAI function calling utilize heavily not required
descriptionschema property and also works better if you can exclude some properties fromrequiredarray.