Enhance ChatGptTypeChecker
and LlmTypeCheckerV3
.
#113
Merged
+469
−5
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.
ChatGptTypeChecker
had not consideredadditionalProperties
case, andLlmTypeCheckerV3
had not defined the visitor function.This pull request includes several updates to the
ChatGptTypeChecker
andLlmTypeCheckerV3
namespaces, as well as adding new test cases for type checker validation. The most important changes include enhancements to the handling of additional properties in schemas, the addition of a newcovers
function inLlmTypeCheckerV3
, and the creation of new test files for validating type checker coverage.Enhancements to schema handling:
src/utils/ChatGptTypeChecker.ts
: Improved handling of additional properties in schemas by adding checks and processing foradditionalProperties
in both object and array schemas. [1] [2] [3]New
covers
function:src/utils/LlmTypeCheckerV3.ts
: Added a newcovers
function that checks if one schema can cover another, including internal helper functions for covering boolean, integer, number, string, array, and object types.New test cases:
test/features/llm/validate_llm_type_checker_cover_any.ts
: Added test cases to validate thecovers
function for various models includingchatgpt
,claude
,gemini
,llama
,3.0
, and3.1
.test/features/llm/validate_llm_type_checker_cover_array.ts
: Added test cases to validate thecovers
function for array schemas across different models, ensuring proper coverage checks for nested schemas.Version update:
package.json
: Updated the version from2.2.0
to2.2.1
.