22
33import com .microsoft .openai .samples .rag .ask .approaches .PlainJavaAskApproach ;
44import com .microsoft .openai .samples .rag .ask .approaches .semantickernel .JavaSemanticKernelChainsApproach ;
5+ import com .microsoft .openai .samples .rag .ask .approaches .semantickernel .JavaSemanticKernelWithVectorStoreApproach ;
56import com .microsoft .openai .samples .rag .chat .approaches .PlainJavaChatApproach ;
67import com .microsoft .openai .samples .rag .chat .approaches .semantickernel .JavaSemanticKernelChainsChatApproach ;
8+ import com .microsoft .openai .samples .rag .chat .approaches .semantickernel .JavaSemanticKernelWithVectorStoreChatApproach ;
79import org .springframework .context .ApplicationContext ;
810import org .springframework .context .ApplicationContextAware ;
911import org .springframework .stereotype .Component ;
@@ -13,7 +15,6 @@ public class RAGApproachFactorySpringBootImpl implements RAGApproachFactory, App
1315
1416 private static final String JAVA_OPENAI_SDK = "jos" ;
1517 private static final String JAVA_SEMANTIC_KERNEL = "jsk" ;
16-
1718 private static final String JAVA_SEMANTIC_KERNEL_PLANNER = "jskp" ;
1819 private ApplicationContext applicationContext ;
1920
@@ -29,6 +30,8 @@ public RAGApproach createApproach(String approachName, RAGType ragType, RAGOptio
2930 if (ragType .equals (RAGType .CHAT )) {
3031 if (JAVA_OPENAI_SDK .equals (approachName )) {
3132 return applicationContext .getBean (PlainJavaChatApproach .class );
33+ } else if (JAVA_SEMANTIC_KERNEL .equals (approachName )) {
34+ return applicationContext .getBean (JavaSemanticKernelWithVectorStoreChatApproach .class );
3235 } else if (
3336 JAVA_SEMANTIC_KERNEL_PLANNER .equals (approachName ) &&
3437 ragOptions != null &&
@@ -39,6 +42,8 @@ public RAGApproach createApproach(String approachName, RAGType ragType, RAGOptio
3942 } else if (ragType .equals (RAGType .ASK )) {
4043 if (JAVA_OPENAI_SDK .equals (approachName ))
4144 return applicationContext .getBean (PlainJavaAskApproach .class );
45+ else if (JAVA_SEMANTIC_KERNEL .equals (approachName ))
46+ return applicationContext .getBean (JavaSemanticKernelWithVectorStoreApproach .class );
4247 else if (JAVA_SEMANTIC_KERNEL_PLANNER .equals (approachName ) && ragOptions != null && ragOptions .getSemantickKernelMode () != null && ragOptions .getSemantickKernelMode () == SemanticKernelMode .chains )
4348 return applicationContext .getBean (JavaSemanticKernelChainsApproach .class );
4449 }
0 commit comments