diff --git a/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/AIServices.java b/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/AIServices.java
index 59cbddbf89..b2da098328 100644
--- a/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/AIServices.java
+++ b/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/AIServices.java
@@ -42,21 +42,27 @@ public class AIServices {
System.out.println("No client key found");
return;
}
-
+
+ //
ChatCompletionService chatCompletionService = ChatCompletionService.builder()
.withModelId(CHAT_MODEL_ID)
.withOpenAIAsyncClient(client)
.build();
-
+ //
+
+ //
TextGenerationService textGenerationService = TextGenerationService.builder()
.withModelId(TEXT_MODEL_ID)
.withOpenAIAsyncClient(client)
.build();
+ //
+ //
Kernel kernel = Kernel.builder()
.withAIService(ChatCompletionService.class, chatCompletionService)
.withAIService(TextGenerationService.class, textGenerationService)
.build();
+ //
}
}
diff --git a/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/ConfiguringPrompts.java b/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/ConfiguringPrompts.java
index 3636008358..beaf8e9532 100644
--- a/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/ConfiguringPrompts.java
+++ b/java/samples/sample-code/src/main/java/com/microsoft/semantickernel/samples/documentationexamples/ConfiguringPrompts.java
@@ -46,15 +46,20 @@ public class ConfiguringPrompts {
return;
}
+ //
ChatCompletionService chatCompletionService = ChatCompletionService.builder()
.withModelId(CHAT_MODEL_ID)
.withOpenAIAsyncClient(client)
.build();
+ //
+ //
Kernel kernel = Kernel.builder()
.withAIService(ChatCompletionService.class, chatCompletionService)
.build();
+ //
+ // chat = KernelFunction.createFromPrompt(
PromptTemplateConfig.builder()
.withName("Chat")
@@ -91,5 +96,6 @@ public class ConfiguringPrompts {
})
.build())
.build();
+ //
ChatCompletionService chatCompletionService = ChatCompletionService.builder()
.withModelId(MODEL_ID)
.withOpenAIAsyncClient(client)
.build();
+ //
+ //
KernelPlugin plugin = KernelPluginFactory.createFromObject(
new ConversationSummaryPlugin(), "ConversationSummaryPlugin");
+ //
+ //
Kernel kernel = Kernel.builder()
.withAIService(ChatCompletionService.class, chatCompletionService)
.withPlugin(plugin)
.build();
+ //
List choices = Arrays.asList("ContinueConversation", "EndConversation");
@@ -88,6 +95,7 @@ public class FunctionsWithinPrompts {
});
// Create handlebars template for intent
+ //
KernelFunction getIntent = KernelFunction.createFromPrompt(
"""
Instructions: What is the intent of this request?
@@ -107,8 +115,10 @@ public class FunctionsWithinPrompts {
""")
.withTemplateFormat("handlebars")
.build();
+ //
// Create a Semantic Kernel template for chat
+ //
KernelFunction chat = KernelFunction.createFromPrompt(
"""
{{ConversationSummaryPlugin.SummarizeConversation $history}}
@@ -116,11 +126,13 @@ public class FunctionsWithinPrompts {
Assistant:
""")
.build();
+ //
// Create chat history
ChatHistory history = new ChatHistory();
// Start the chat loop
+ //
while (true) {
// Get user input
System.console().printf("User > ");
@@ -162,6 +174,7 @@ public class FunctionsWithinPrompts {
history.addUserMessage(request);
history.addAssistantMessage(message);
}
+ //
}
}