Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add semantic kernel vector store approaches #106

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions app/backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<java.version>17</java.version>

<spring-cloud-azure.version>5.14.0</spring-cloud-azure.version>
<azure-search.version>11.6.0-beta.8</azure-search.version>
<semantic-kernel.version>1.2.2</semantic-kernel.version>
<azure-search.version>11.7.2</azure-search.version>
<semantic-kernel.version>1.4.1</semantic-kernel.version>
<mockito-inline.version>4.5.1</mockito-inline.version>
<maven.compiler-plugin.version>3.11.0</maven.compiler-plugin.version>

Expand Down Expand Up @@ -123,6 +123,10 @@
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-aiservices-openai</artifactId>
</dependency>
<dependency>
<groupId>com.microsoft.semantic-kernel</groupId>
<artifactId>semantickernel-data-azureaisearch</artifactId>
</dependency>
<!-- Semantic Kernel end -->
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.microsoft.openai.samples.rag.ask.approaches.PlainJavaAskApproach;
import com.microsoft.openai.samples.rag.ask.approaches.semantickernel.JavaSemanticKernelChainsApproach;
import com.microsoft.openai.samples.rag.ask.approaches.semantickernel.JavaSemanticKernelWithVectorStoreApproach;
import com.microsoft.openai.samples.rag.chat.approaches.PlainJavaChatApproach;
import com.microsoft.openai.samples.rag.chat.approaches.semantickernel.JavaSemanticKernelChainsChatApproach;
import com.microsoft.openai.samples.rag.chat.approaches.semantickernel.JavaSemanticKernelWithVectorStoreChatApproach;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
Expand All @@ -13,7 +15,6 @@ public class RAGApproachFactorySpringBootImpl implements RAGApproachFactory, App

private static final String JAVA_OPENAI_SDK = "jos";
private static final String JAVA_SEMANTIC_KERNEL = "jsk";

private static final String JAVA_SEMANTIC_KERNEL_PLANNER = "jskp";
private ApplicationContext applicationContext;

Expand All @@ -29,6 +30,8 @@ public RAGApproach createApproach(String approachName, RAGType ragType, RAGOptio
if (ragType.equals(RAGType.CHAT)) {
if (JAVA_OPENAI_SDK.equals(approachName)) {
return applicationContext.getBean(PlainJavaChatApproach.class);
} else if (JAVA_SEMANTIC_KERNEL.equals(approachName)) {
return applicationContext.getBean(JavaSemanticKernelWithVectorStoreChatApproach.class);
} else if (
JAVA_SEMANTIC_KERNEL_PLANNER.equals(approachName) &&
ragOptions != null &&
Expand All @@ -39,6 +42,8 @@ public RAGApproach createApproach(String approachName, RAGType ragType, RAGOptio
} else if (ragType.equals(RAGType.ASK)) {
if (JAVA_OPENAI_SDK.equals(approachName))
return applicationContext.getBean(PlainJavaAskApproach.class);
else if (JAVA_SEMANTIC_KERNEL.equals(approachName))
return applicationContext.getBean(JavaSemanticKernelWithVectorStoreApproach.class);
else if (JAVA_SEMANTIC_KERNEL_PLANNER.equals(approachName) && ragOptions != null && ragOptions.getSemantickKernelMode() != null && ragOptions.getSemantickKernelMode() == SemanticKernelMode.chains)
return applicationContext.getBean(JavaSemanticKernelChainsApproach.class);
}
Expand Down

This file was deleted.

Loading
Loading