|
2 | 2 |
|
3 | 3 | import com.microsoft.openai.OpenAIAsyncClient; |
4 | 4 | import com.microsoft.semantickernel.extensions.KernelExtensions; |
5 | | -import com.microsoft.semantickernel.planner.sequentialplanner.SequentialPlanner; |
6 | | -import java.io.IOException; |
| 5 | +// import com.microsoft.semantickernel.planner.sequentialplanner.SequentialPlanner; |
7 | 6 |
|
8 | 7 | public class Example05UsingThePlanner { |
9 | 8 |
|
10 | | - public static SequentialPlanner getPlanner(Kernel kernel) { |
11 | | - kernel.importSkills("SummarizeSkill", KernelExtensions.importSemanticSkillFromDirectory( |
12 | | - "samples/skills", "SummarizeSkill")); |
13 | | - kernel.importSkills("WriterSkill", KernelExtensions.importSemanticSkillFromDirectory( |
14 | | - "samples/skills", "WriterSkill")); |
| 9 | +// public static SequentialPlanner getPlanner(Kernel kernel) { |
| 10 | +// kernel.importSkills("SummarizeSkill", KernelExtensions.importSemanticSkillFromDirectory( |
| 11 | +// "samples/skills", "SummarizeSkill")); |
| 12 | +// kernel.importSkills("WriterSkill", KernelExtensions.importSemanticSkillFromDirectory( |
| 13 | +// "samples/skills", "WriterSkill")); |
| 14 | +// |
| 15 | +// return new SequentialPlanner(kernel, null, null); |
| 16 | +// } |
| 17 | +// |
| 18 | +// public static void run (boolean useAzureOpenAI) { |
| 19 | +// OpenAIAsyncClient client = Example00GettingStarted.getClient(useAzureOpenAI); |
| 20 | +// Kernel kernel = Example00GettingStarted.getKernel(client); |
| 21 | +// |
| 22 | +// SequentialPlanner planner = getPlanner(kernel); |
| 23 | +// System.out.println(planner.createPlanAsync( |
| 24 | +// "Write a poem about John Doe, then translate it into Italian.") |
| 25 | +// .block().getResult()); |
| 26 | +// |
| 27 | +// // TODO: execute the plan |
| 28 | +// } |
| 29 | +// |
| 30 | +// public static void main (String[] args) { |
| 31 | +// run(false); |
| 32 | +// } |
15 | 33 |
|
16 | | - return new SequentialPlanner(kernel, null, null); |
17 | | - } |
18 | | - |
19 | | - public static void run (boolean useAzureOpenAI) { |
20 | | - OpenAIAsyncClient client = Example00GettingStarted.getClient(useAzureOpenAI); |
21 | | - Kernel kernel = Example00GettingStarted.getKernel(client); |
22 | | - |
23 | | - SequentialPlanner planner = getPlanner(kernel); |
24 | | - System.out.println(planner.createPlanAsync( |
25 | | - "Write a poem about John Doe, then translate it into Italian.") |
26 | | - .block().getResult()); |
27 | | - |
28 | | - // TODO: execute the plan |
29 | | - } |
30 | | - |
31 | | - public static void main (String[] args) { |
32 | | - run(false); |
33 | | - } |
34 | 34 | } |
0 commit comments