New function LlmSchemaComposer.invert()
#142
Merged
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.
This pull request includes significant updates to the
LlmSchemaComposer
module, including the introduction of inversion functions for various schema composers and the addition of theLlmDescriptionInverter
utility. These changes enhance the functionality and flexibility of the schema composers by allowing the inversion of schema descriptions.Key changes include:
Version Update
package.json
: Updated the version from2.4.3
to2.5.0
.Inversion Functions
src/composers/LlmSchemaComposer.ts
: Added aninvert
function and anINVERTS
constant to support schema inversion. [1] [2]src/composers/llm/ChatGptSchemaComposer.ts
: Introduced aninvert
function and added sections for converters and separators. [1] [2] [3]src/composers/llm/ClaudeSchemaComposer.ts
,src/composers/llm/GeminiSchemaComposer.ts
,src/composers/llm/LlamaSchemaComposer.ts
: Addedinvert
functions to support schema inversion. [1] [2] [3]Utility Additions
src/composers/llm/LlmDescriptionInverter.ts
: Added theLlmDescriptionInverter
utility to handle inversion of numeric, string, and array descriptions.src/composers/llm/LlmSchemaV3Composer.ts
,src/composers/llm/LlmSchemaV3_1Composer.ts
: Integrated theLlmDescriptionInverter
and added sections for converters, separators, and inverters. [1] [2] [3] [4] [5] [6] [7]Miscellaneous
src/utils/OpenApiConstraintShifter.ts
: Adjusted the handling ofexclusiveMinimum
andexclusiveMaximum
properties to avoid conflicts. [1] [2]