Skip to content

Commit 79865aa

Browse files
committed
Small fixes
1 parent 1ff4d5a commit 79865aa

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

orchestration/src/main/java/com/sap/ai/sdk/orchestration/ResponseJsonSchema.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public static ResponseJsonSchema of(
7070
*/
7171
@Nonnull
7272
public static ResponseJsonSchema from(@Nonnull final Type classType) {
73-
// Build JSON schema from class
7473
val module =
7574
new JacksonModule(
7675
JacksonOption.RESPECT_JSONPROPERTY_REQUIRED, JacksonOption.RESPECT_JSONPROPERTY_ORDER);
@@ -82,13 +81,9 @@ public static ResponseJsonSchema from(@Nonnull final Type classType) {
8281
.with(module)
8382
.build());
8483
val jsonSchema = generator.generateSchema(classType);
85-
86-
// Convert JSON schema to Map
8784
val mapper = new ObjectMapper();
8885
final Map<String, Object> schemaMap = mapper.convertValue(jsonSchema, new TypeReference<>() {});
89-
9086
val schemaName = ((Class<?>) classType).getSimpleName() + "-Schema";
91-
9287
return new ResponseJsonSchema(schemaMap, schemaName, null, null);
9388
}
9489
}

orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void testGroundingPrompt() {
199199
}
200200

201201
@Test
202-
void testResponseFormatNotOverwrittenWithNewTemplateConfig() {
202+
void testResponseFormatNotOverwrittenByNewTemplateConfig() {
203203
var schema = ResponseJsonSchema.from(TestClassForSchemaGeneration.class);
204204
var config = new OrchestrationModuleConfig().withJsonSchemaResponse(schema);
205205
assertThat(((Template) config.getTemplateConfig())).isNotNull();

0 commit comments

Comments
 (0)