AI rule node: correct method name for schema adapter

This commit is contained in:
Dmytro Skarzhynets 2025-07-04 14:52:19 +03:00
parent 030f8ce974
commit cdb7e3b0c0
No known key found for this signature in database
GPG Key ID: 2B51652F224037DF
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ final class Langchain4jJsonSchemaAdapter {
* @param rootSchemaNode a valid JSON Schema as a Jackson {@link ObjectNode} * @param rootSchemaNode a valid JSON Schema as a Jackson {@link ObjectNode}
* @return the corresponding Langchain4j {@link JsonSchema} * @return the corresponding Langchain4j {@link JsonSchema}
*/ */
public static JsonSchema fromJsonNode(ObjectNode rootSchemaNode) { public static JsonSchema fromObjectNode(ObjectNode rootSchemaNode) {
return JsonSchema.builder() return JsonSchema.builder()
.name(rootSchemaNode.get("title").textValue()) .name(rootSchemaNode.get("title").textValue())
.rootElement(parse(rootSchemaNode)) .rootElement(parse(rootSchemaNode))

View File

@ -84,7 +84,7 @@ public final class TbAiNode extends TbAbstractExternalNode implements TbNode {
if (config.getResponseFormatType() == ResponseFormatType.JSON) { if (config.getResponseFormatType() == ResponseFormatType.JSON) {
responseFormat = ResponseFormat.builder() responseFormat = ResponseFormat.builder()
.type(config.getResponseFormatType()) .type(config.getResponseFormatType())
.jsonSchema(config.getJsonSchema() != null ? Langchain4jJsonSchemaAdapter.fromJsonNode(config.getJsonSchema()) : null) .jsonSchema(config.getJsonSchema() != null ? Langchain4jJsonSchemaAdapter.fromObjectNode(config.getJsonSchema()) : null)
.build(); .build();
} }