Skip to content

Commit 5f40937

Browse files
committed
update sk sdk to 1.0.2 and azure openai sdk to 1.0.0.0-beta-8
1 parent 226cede commit 5f40937

File tree

9 files changed

+12
-14
lines changed

9 files changed

+12
-14
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ What this demo application does:
4343
![Chat screen](docs/chatscreen.png)
4444

4545

46-
## Solution Architecture and deployment options
46+
## Solution architecture and deployment options
4747

4848
![Microservice RAG Architecture](docs/aks/aks-hla.png)
4949

@@ -53,7 +53,7 @@ This sample supports different architectural styles. It can be deployed as stand
5353
- For **Azure Container Apps** deployment, see [here](docs/aca/README-ACA.md).
5454
- For **Azure Kubernetes Service** deployment, see [here](docs/aks/README-AKS.md).
5555

56-
## RAG Implementation Options
56+
## RAG implementation options
5757
This repo is focused to showcase different options to implement **"chat with your private documents"** scenario using RAG patterns with Java, Azure OpenAI and Semantic Kernel.
5858
Below you can find the list of available implementations.
5959

@@ -67,7 +67,7 @@ Below you can find the list of available implementations.
6767
| Chat | [JavaSemanticKernelChainsApproach](https://github.com/Azure-Samples/azure-search-openai-demo-java/blob/main/app/backend/src/main/java/com/microsoft/openai/samples/rag/chat/approaches/semantickernel/JavaSemanticKernelChainsChatApproach.java) | Use Java Semantic Kernel framework with semantic and native functions chaining. It uses an imperative style for AI orchestration through semantic kernel functions chaining. [InformationFinder.SearchFromConversation](https://github.com/Azure-Samples/azure-search-openai-demo-java/blob/main/app/backend/src/main/java/com/microsoft/openai/samples/rag/retrieval/semantickernel/CognitiveSearchPlugin.java) native function and [RAG.AnswerConversation](https://github.com/Azure-Samples/azure-search-openai-demo-java/blob/main/app/backend/src/main/resources/semantickernel/Plugins/RAG/AnswerConversation/config.json) semantic function are called sequentially. Several search retrieval options are available: Text, Vector, Hybrid. | :x: | :white_check_mark: |
6868

6969

70-
## Production Deployment on Azure Application Landing Zones
70+
## Production deployment on Azure Application Landing Zones
7171

7272
This sample is designed to get you started quickly and let you experiment with Java intelligent Apps RAG architectures on Azure. For production deployment, you can use the [Azure Application Landing Zones (LZA)](https://learn.microsoft.com/en-us/azure/cloud-adoption-framework/scenarios/app-platform/ready) to deploy the solution maintaining best practices for security, monitoring, networking and operational excellence.
7373

app/backend/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<spring-cloud-azure.version>4.9.0</spring-cloud-azure.version>
2020
<azure-search.version>11.6.0-beta.8</azure-search.version>
21-
<semantic-kernel.version>1.0.1</semantic-kernel.version>
21+
<semantic-kernel.version>1.0.2</semantic-kernel.version>
2222
<mockito-inline.version>4.5.1</mockito-inline.version>
2323
<maven.compiler-plugin.version>3.11.0</maven.compiler-plugin.version>
2424

app/backend/src/main/java/com/microsoft/openai/samples/rag/retrieval/CognitiveSearchRetriever.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ public List<ContentSource> retrieveFromQuestion(String question, RAGOptions ragO
6565

6666
Embeddings response = openAIProxy.getEmbeddings(List.of(question));
6767
var questionVector =
68-
response.getData().get(0).getEmbedding().stream()
69-
.map(Double::floatValue)
70-
.toList();
68+
response.getData().get(0).getEmbedding();
7169
if (ragOptions.getRetrievalMode() == RetrievalMode.vectors) {
7270
setSearchOptionsForVector(ragOptions, questionVector, searchOptions);
7371
} else {

app/frontend/.env.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_BACKEND_URI=http://127.0.0.1:8081/api
1+
VITE_BACKEND_URI=http://localhost:8081/api

app/frontend/.env.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_BACKEND_URI=http://127.0.0.1:8081/api
1+
VITE_BACKEND_URI=http://localhost:8081/api

app/indexer/core/src/main/java/com/microsoft/openai/samples/indexer/embeddings/AbstractTextEmbeddingsService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ public AbstractTextEmbeddingsService(String openAiDeploymentName, boolean verbos
4444
protected abstract OpenAIAsyncClient createClient();
4545

4646

47-
public List<List<Double>> createEmbeddingBatch(List<String> texts) {
47+
public List<List<Float>> createEmbeddingBatch(List<String> texts) {
4848
List<EmbeddingBatch> batches = splitTextIntoBatches(texts);
49-
List<List<Double>> embeddings = new ArrayList<>();
49+
List<List<Float>> embeddings = new ArrayList<>();
5050
OpenAIAsyncClient client = createClient();
5151
for (int batchIndex =0; batchIndex < batches.size(); batchIndex++) {
5252
EmbeddingBatch batch = batches.get(batchIndex);

app/indexer/core/src/main/java/com/microsoft/openai/samples/indexer/embeddings/TextEmbeddingsService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
public interface TextEmbeddingsService {
66

7-
public List<List<Double>> createEmbeddingBatch(List<String> texts);
7+
public List<List<Float>> createEmbeddingBatch(List<String> texts);
88
}

app/indexer/core/src/main/java/com/microsoft/openai/samples/indexer/index/SearchIndexManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public void updateContent(List<Section> sections) {
154154

155155

156156
//Create embeddings for sections.
157-
List<List<Double>> embeddings = embeddingsService.createEmbeddingBatch(textsToEmbed);
157+
List<List<Float>> embeddings = embeddingsService.createEmbeddingBatch(textsToEmbed);
158158

159159
//Embeddings are assigned back to section using index in batch. Using Array List assure ordering is preserved.
160160
for (int i = 0; i < documents.size(); i++) {

app/indexer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.source>17</maven.compiler.source>
1414
<maven.compiler.target>17</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<azure-openai.version>1.0.0-beta.6</azure-openai.version>
16+
<azure-openai.version>1.0.0-beta.8</azure-openai.version>
1717
<azure-document-intelligence.version>4.1.4</azure-document-intelligence.version>
1818
<itextpdf.version>5.5.13.3</itextpdf.version>
1919
<apache.common.text>1.11.0</apache.common.text>

0 commit comments

Comments
 (0)