Skip to content

Commit dd65092

Browse files
committed
add support for chatGptDeploymentSkuName param
1 parent 52a70f6 commit dd65092

File tree

7 files changed

+32
-11
lines changed

7 files changed

+32
-11
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
package com.microsoft.openai.samples.indexer;
22

3-
import java.io.File;
4-
import java.io.IOException;
5-
import java.nio.file.Files;
6-
import java.nio.file.Path;
7-
import java.util.List;
8-
import java.util.stream.Collectors;
9-
103
import com.microsoft.openai.samples.indexer.index.SearchIndexManager;
114
import com.microsoft.openai.samples.indexer.parser.PDFParser;
125
import com.microsoft.openai.samples.indexer.parser.Page;
136
import com.microsoft.openai.samples.indexer.parser.TextSplitter;
147
import org.slf4j.Logger;
158
import org.slf4j.LoggerFactory;
169

10+
import java.io.IOException;
11+
import java.nio.file.Files;
12+
import java.nio.file.Path;
13+
import java.util.List;
14+
import java.util.stream.Collectors;
15+
1716
/**
1817
* The DocumentProcessor class is responsible for processing and indexing documents.
1918
* It takes a document as input, either as a file or as a byte array, and processes it for indexing.
@@ -47,6 +46,7 @@ public void indexDocumentfromFile(String filepath, String category) throws IOExc
4746

4847
public void indexDocumentFromBytes(String filename, String category, byte[] content){
4948
logger.debug("Indexing file {}", filename);
49+
5050
//TODO add support for other file types (docx, pptx, txt, md, html, etc)
5151
List<Page> pages = pdfParser.parse(content);
5252
logger.info("Found {} pages in file {}", pages.size(), filename);

deploy/aca/infra/main.bicep

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ param chatGptDeploymentCapacity int = 60
6464
param chatGptModelName string = 'gpt-35-turbo'
6565
param chatGptModelVersion string = '0613'
6666
param embeddingDeploymentName string // Set in main.parameters.json
67-
param embeddingDeploymentCapacity int = 80
67+
param embeddingDeploymentCapacity int = 60
68+
param chatGptDeploymentSkuName string= 'Standard'
6869
param embeddingModelName string = 'text-embedding-ada-002'
6970

7071
param servicebusNamespace string = ''
@@ -307,7 +308,7 @@ module openAi '../../shared/ai/cognitiveservices.bicep' = {
307308
version: chatGptModelVersion
308309
}
309310
sku: {
310-
name: 'Standard'
311+
name: chatGptDeploymentSkuName
311312
capacity: chatGptDeploymentCapacity
312313
}
313314
}

deploy/aca/infra/main.parameters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
"chatGptDeploymentName": {
7878
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
7979
},
80+
"chatGptDeploymentCapacity": {
81+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY=60}"
82+
},
83+
"chatGptDeploymentSkuName": {
84+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU_NAME=Standard}"
85+
},
8086
"embeddingDeploymentName": {
8187
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
8288
},

deploy/aks/infra/main.bicep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ param chatGptModelName string = 'gpt-35-turbo'
6767
param chatGptModelVersion string = '0613'
6868
param embeddingDeploymentName string // Set in main.parameters.json
6969
param embeddingDeploymentCapacity int = 80
70+
param chatGptDeploymentSkuName string= 'Standard'
7071
param embeddingModelName string = 'text-embedding-ada-002'
7172

7273
param servicebusNamespace string = ''
@@ -177,7 +178,7 @@ module openAi '../../shared/ai/cognitiveservices.bicep' = if (openAiHost == 'azu
177178
version: chatGptModelVersion
178179
}
179180
sku: {
180-
name: 'Standard'
181+
name: chatGptDeploymentSkuName
181182
capacity: chatGptDeploymentCapacity
182183
}
183184
}

deploy/aks/infra/main.parameters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
"chatGptDeploymentName": {
7878
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
7979
},
80+
"chatGptDeploymentCapacity": {
81+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY=60}"
82+
},
83+
"chatGptDeploymentSkuName": {
84+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU_NAME=Standard}"
85+
},
8086
"embeddingDeploymentName": {
8187
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
8288
},

deploy/app-service/infra/main.bicep

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ param formRecognizerSkuName string = 'S0'
6262

6363
param chatGptDeploymentName string // Set in main.parameters.json
6464
param chatGptDeploymentCapacity int = 60
65+
param chatGptDeploymentSkuName string= 'Standard'
6566
param chatGptModelName string = 'gpt-35-turbo'
6667
param chatGptModelVersion string = '0613'
6768
param embeddingDeploymentName string // Set in main.parameters.json
@@ -238,7 +239,7 @@ module openAi '../../shared/ai/cognitiveservices.bicep' = if (openAiHost == 'azu
238239
version: chatGptModelVersion
239240
}
240241
sku: {
241-
name: 'Standard'
242+
name: chatGptDeploymentSkuName
242243
capacity: chatGptDeploymentCapacity
243244
}
244245
}

deploy/app-service/infra/main.parameters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
"chatGptDeploymentName": {
7878
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
7979
},
80+
"chatGptDeploymentCapacity": {
81+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY=60}"
82+
},
83+
"chatGptDeploymentSkuName": {
84+
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU_NAME=Standard}"
85+
},
8086
"embeddingDeploymentName": {
8187
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
8288
},

0 commit comments

Comments
 (0)