File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1010import com .sap .ai .sdk .orchestration .DpiMasking ;
1111import com .sap .ai .sdk .orchestration .OrchestrationClientException ;
1212import com .sap .ai .sdk .orchestration .OrchestrationModuleConfig ;
13- import com .sap .ai .sdk .orchestration .ResponseJsonSchema ;
14- import com .sap .ai .sdk .orchestration .TemplateConfig ;
1513import com .sap .ai .sdk .orchestration .model .DPIEntities ;
1614import com .sap .ai .sdk .orchestration .spring .OrchestrationChatModel ;
1715import com .sap .ai .sdk .orchestration .spring .OrchestrationChatOptions ;
@@ -261,13 +259,9 @@ public record Translation(
261259 public Translation responseFormat () {
262260 val cl = ChatClient .builder (new OrchestrationChatModel ()).build ();
263261
264- val schema = ResponseJsonSchema .fromType (Translation .class );
265- val template = TemplateConfig .create ().withJsonSchemaResponse (schema );
266-
267- val options = new OrchestrationChatOptions (config .withTemplateConfig (template ));
268262 val prompt =
269- new Prompt ("How do I say 'AI is going to revolutionize the world' in dutch?" , options );
270-
263+ new Prompt (
264+ "How do I say 'AI is going to revolutionize the world' in dutch?" , defaultOptions );
271265 return cl .prompt (prompt ).call ().entity (Translation .class );
272266 }
273267}
You can’t perform that action at this time.
0 commit comments