2
2
3
3
import com .microsoft .openai .samples .rag .ask .approaches .PlainJavaAskApproach ;
4
4
import com .microsoft .openai .samples .rag .ask .approaches .semantickernel .JavaSemanticKernelChainsApproach ;
5
+ import com .microsoft .openai .samples .rag .ask .approaches .semantickernel .JavaSemanticKernelWithVectorStoreApproach ;
5
6
import com .microsoft .openai .samples .rag .chat .approaches .PlainJavaChatApproach ;
6
7
import com .microsoft .openai .samples .rag .chat .approaches .semantickernel .JavaSemanticKernelChainsChatApproach ;
8
+ import com .microsoft .openai .samples .rag .chat .approaches .semantickernel .JavaSemanticKernelWithVectorStoreChatApproach ;
7
9
import org .springframework .context .ApplicationContext ;
8
10
import org .springframework .context .ApplicationContextAware ;
9
11
import org .springframework .stereotype .Component ;
@@ -13,7 +15,6 @@ public class RAGApproachFactorySpringBootImpl implements RAGApproachFactory, App
13
15
14
16
private static final String JAVA_OPENAI_SDK = "jos" ;
15
17
private static final String JAVA_SEMANTIC_KERNEL = "jsk" ;
16
-
17
18
private static final String JAVA_SEMANTIC_KERNEL_PLANNER = "jskp" ;
18
19
private ApplicationContext applicationContext ;
19
20
@@ -29,6 +30,8 @@ public RAGApproach createApproach(String approachName, RAGType ragType, RAGOptio
29
30
if (ragType .equals (RAGType .CHAT )) {
30
31
if (JAVA_OPENAI_SDK .equals (approachName )) {
31
32
return applicationContext .getBean (PlainJavaChatApproach .class );
33
+ } else if (JAVA_SEMANTIC_KERNEL .equals (approachName )) {
34
+ return applicationContext .getBean (JavaSemanticKernelWithVectorStoreChatApproach .class );
32
35
} else if (
33
36
JAVA_SEMANTIC_KERNEL_PLANNER .equals (approachName ) &&
34
37
ragOptions != null &&
@@ -39,6 +42,8 @@ public RAGApproach createApproach(String approachName, RAGType ragType, RAGOptio
39
42
} else if (ragType .equals (RAGType .ASK )) {
40
43
if (JAVA_OPENAI_SDK .equals (approachName ))
41
44
return applicationContext .getBean (PlainJavaAskApproach .class );
45
+ else if (JAVA_SEMANTIC_KERNEL .equals (approachName ))
46
+ return applicationContext .getBean (JavaSemanticKernelWithVectorStoreApproach .class );
42
47
else if (JAVA_SEMANTIC_KERNEL_PLANNER .equals (approachName ) && ragOptions != null && ragOptions .getSemantickKernelMode () != null && ragOptions .getSemantickKernelMode () == SemanticKernelMode .chains )
43
48
return applicationContext .getBean (JavaSemanticKernelChainsApproach .class );
44
49
}
0 commit comments