mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
Java: Fix printing result in Example05 (#1982)
Remove stub example Example06_MemoryAndEmbeddings.java
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ public class Example05_UsingThePlanner {
|
||||
SequentialPlanner planner = getPlanner(kernel);
|
||||
System.out.println(planner.createPlanAsync(
|
||||
"Write a poem about John Doe, then translate it into Italian.")
|
||||
.block().invokeAsync().block());
|
||||
.block().invokeAsync().block().getResult());
|
||||
|
||||
// TODO: execute the plan
|
||||
}
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
package com.microsoft.semantickernel;
|
||||
|
||||
import com.azure.ai.openai.OpenAIAsyncClient;
|
||||
import com.microsoft.semantickernel.builders.SKBuilders;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class Example06_MemoryAndEmbeddings {
|
||||
|
||||
public static Kernel getKernel(OpenAIAsyncClient client) {
|
||||
KernelConfig config = SKBuilders.kernelConfig()
|
||||
.addTextCompletionService(
|
||||
"davinci", kernel -> SKBuilders.textCompletionService().build(client, "text-davinci-003"))
|
||||
.build();
|
||||
|
||||
// TODO: Add Volatile memory
|
||||
|
||||
Kernel kernel = SKBuilders.kernel()
|
||||
.withKernelConfig(config)
|
||||
.build();
|
||||
|
||||
return kernel;
|
||||
}
|
||||
|
||||
public static void run(Config.ClientType clientType) throws IOException {
|
||||
Kernel kernel = getKernel(clientType.getClient());
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
// Send one of Config.ClientType.OPEN_AI or Config.ClientType.AZURE_OPEN_AI
|
||||
run(Config.ClientType.OPEN_AI);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user