-
Notifications
You must be signed in to change notification settings - Fork 83
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
base: main
Are you sure you want to change the base?
Conversation
String indexName; | ||
|
||
@Value("${openai.chatgpt.deployment}") | ||
private String gptChatDeploymentModelId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required. we can delete this
private String gptChatDeploymentModelId; | ||
|
||
@Value("${openai.embedding.deployment}") | ||
private String embeddingDeploymentModelId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required. we can delete this
@Value("${cognitive.search.index}") | ||
String indexName; | ||
@Value("${openai.chatgpt.deployment}") | ||
private String gptChatDeploymentModelId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required. we can delete this.
@Value("${openai.chatgpt.deployment}") | ||
private String gptChatDeploymentModelId; | ||
@Value("${openai.embedding.deployment}") | ||
private String embeddingDeploymentModelId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required. we can delete this.
Kernel semanticKernel = buildSemanticKernel(); | ||
|
||
// STEP 1: Create Azure AI Search client | ||
SearchIndexAsyncClient client = new SearchIndexClientBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this instance configuration in com.microsoft.openai.samples.rag.config.AzureAISearchConfiguration and let spring initialize it through constructor injection?
Kernel semanticKernel = buildSemanticKernel(options); | ||
|
||
// STEP 1: Create Azure AI Search client | ||
SearchIndexAsyncClient client = new SearchIndexClientBuilder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this instance configuration in com.microsoft.openai.samples.rag.config.AzureAISearchConfiguration and let spring initialize it through constructor injection?
); | ||
|
||
// STEP 3: Retrieve relevant documents using keywords extracted from the chat history | ||
String conversationString = ChatGPTUtils.formatAsChatML(questionOrConversation.toOpenAIChatMessages()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a duplication. let's use SK ChatHistory we have in conversation variable at line 72
import java.util.Optional; | ||
import java.util.stream.Collectors; | ||
|
||
public class AzureAISearchVectorStoreApproach { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the class name with something which doesn't create confusion with JavaSemanticKernelWithVector..Approach.java name?.. Maybe something like AzureAISearchVectorStoreUtils ?
|
||
private static final String EMBEDDING_FIELD_NAME = "embedding"; | ||
|
||
public static class MemoryRecord { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we call this DocumentRecord ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milderhc what if we make the SK vector store (JavaSemanticKernelWithVectorStoreChatApproach) option the default one for semantic kernel? I think this will provide a better message about simplifying RAG implementation with semantic kernel compared to the one using SK chains. JavaSemanticKernelChainsChatApproach can still be there in repo for exploration purpose but not should not be addressable from the UI
Purpose
Does this introduce a breaking change?
Pull Request Type
What kind of change does this Pull Request introduce?
How to Test
What to Check
Verify that the following are valid
Other Information