Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ private void generateSchema() {
SchemaGeneratorConfig config = configBuilder.build();
SchemaGenerator generator = new SchemaGenerator(config);
JsonNode jsonNode = generator.generateSchema(this.type);
postProcessSchema(jsonNode);
ObjectWriter objectWriter = this.objectMapper.writer(new DefaultPrettyPrinter()
.withObjectIndenter(new DefaultIndenter().withLinefeed(System.lineSeparator())));
try {
Expand All @@ -214,6 +215,13 @@ private void generateSchema() {
}
}

/**
* Empty template method that allows for customization of the JSON schema in subclasses.
* @param jsonNode the JSON schema, in the form of a JSON node
*/
protected void postProcessSchema(@NonNull JsonNode jsonNode) {
}

/**
* Parses the given text to transform it to the desired target type.
* @param text The LLM output in string format.
Expand Down