Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing incorrect end comma in jsonStructure for POJO extracting AI Services #894

Merged
merged 2 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private static String jsonStructure(Class<?> structured, Set<Class<?>> visited)
}
jsonSchema.append(format("\"%s\": (%s),\n", name, descriptionFor(field, visited)));
}
jsonSchema.delete(jsonSchema.lastIndexOf(","), jsonSchema.lastIndexOf(",")+1);
LizeRaes marked this conversation as resolved.
Show resolved Hide resolved
jsonSchema.append("}");
return jsonSchema.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void outputFormatInstructions_SimplePerson() {
"\nYou must answer strictly in the following JSON format: {\n" +
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"birthDate\": (type: date string (2023-12-31)),\n" +
"\"birthDate\": (type: date string (2023-12-31))\n" +
"}");
}

Expand All @@ -43,7 +43,7 @@ void outputFormatInstructions_PersonWithFirstNameList() {
"\nYou must answer strictly in the following JSON format: {\n" +
"\"firstName\": (type: array of string),\n" +
"\"lastName\": (type: string),\n" +
"\"birthDate\": (type: date string (2023-12-31)),\n" +
"\"birthDate\": (type: date string (2023-12-31))\n" +
"}");
}

Expand All @@ -61,7 +61,7 @@ void outputFormatInstructions_PersonWithFirstNameArray() {
"\nYou must answer strictly in the following JSON format: {\n" +
"\"firstName\": (type: array of string),\n" +
"\"lastName\": (type: string),\n" +
"\"birthDate\": (type: date string (2023-12-31)),\n" +
"\"birthDate\": (type: date string (2023-12-31))\n" +
"}");
}

Expand All @@ -79,7 +79,7 @@ void outputFormatInstructions_PersonWithJavaType() {
"\nYou must answer strictly in the following JSON format: {\n" +
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"birthDate\": (type: java.util.Calendar),\n" +
"\"birthDate\": (type: java.util.Calendar)\n" +
"}");
}

Expand All @@ -98,7 +98,7 @@ void outputFormatInstructions_PersonWithStaticFinalField() {
"\nYou must answer strictly in the following JSON format: {\n" +
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"birthDate\": (type: date string (2023-12-31)),\n" +
"\"birthDate\": (type: date string (2023-12-31))\n" +
"}");
}

Expand Down Expand Up @@ -127,8 +127,8 @@ void outputFormatInstructions_PersonWithNestedObject() {
"\"address\": (type: dev.langchain4j.service.ServiceOutputParserTest$Address: {\n" +
"\"streetNumber\": (type: integer),\n" +
"\"street\": (type: string),\n" +
"\"city\": (type: string),\n" +
"}),\n" +
"\"city\": (type: string)\n" +
"})\n" +
"}");
}

Expand All @@ -151,8 +151,8 @@ void outputFormatInstructions_PersonWithNestedObjectList() {
"\"address\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$Address: {\n" +
"\"streetNumber\": (type: integer),\n" +
"\"street\": (type: string),\n" +
"\"city\": (type: string),\n" +
"}),\n" +
"\"city\": (type: string)\n" +
"})\n" +
"}");
}

Expand All @@ -175,8 +175,8 @@ void outputFormatInstructions_PersonWithNestedObjectArray() {
"\"address\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$Address: {\n" +
"\"streetNumber\": (type: integer),\n" +
"\"street\": (type: string),\n" +
"\"city\": (type: string),\n" +
"}),\n" +
"\"city\": (type: string)\n" +
"})\n" +
"}");
}

Expand All @@ -200,7 +200,7 @@ void outputFormatInstructions_PersonWithFinalFields() {
"\nYou must answer strictly in the following JSON format: {\n" +
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"birthDate\": (type: date string (2023-12-31)),\n" +
"\"birthDate\": (type: date string (2023-12-31))\n" +
"}");
}

Expand All @@ -221,8 +221,8 @@ void outputFormatInstructions_PersonWithParents() {
"\"parents\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$PersonWithParents: {\n" +
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"parents\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$PersonWithParents),\n" +
"}),\n" +
"\"parents\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$PersonWithParents)\n" +
"})\n" +
"}");
}

Expand All @@ -243,8 +243,8 @@ void outputFormatInstructions_PersonWithParentArray() {
"\"parents\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$PersonWithParentArray: {\n" +
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"parents\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$PersonWithParentArray),\n" +
"}),\n" +
"\"parents\": (type: array of dev.langchain4j.service.ServiceOutputParserTest$PersonWithParentArray)\n" +
"})\n" +
"}");
}

Expand All @@ -267,9 +267,9 @@ void outputFormatInstructions_PersonWithMotherAndFather() {
"\"firstName\": (type: string),\n" +
"\"lastName\": (type: string),\n" +
"\"mother\": (type: dev.langchain4j.service.ServiceOutputParserTest$PersonWithMotherAndFather),\n" +
"\"father\": (type: dev.langchain4j.service.ServiceOutputParserTest$PersonWithMotherAndFather),\n" +
"\"father\": (type: dev.langchain4j.service.ServiceOutputParserTest$PersonWithMotherAndFather)\n" +
"}),\n" +
"\"father\": (type: dev.langchain4j.service.ServiceOutputParserTest$PersonWithMotherAndFather),\n" +
"\"father\": (type: dev.langchain4j.service.ServiceOutputParserTest$PersonWithMotherAndFather)\n" +
"}");
}

Expand Down