Skip to content

Commit

Permalink
add support for chatGptDeploymentSkuName param
Browse files Browse the repository at this point in the history
  • Loading branch information
dantelmomsft committed Oct 23, 2024
1 parent 52a70f6 commit dd65092
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.microsoft.openai.samples.indexer;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;

import com.microsoft.openai.samples.indexer.index.SearchIndexManager;
import com.microsoft.openai.samples.indexer.parser.PDFParser;
import com.microsoft.openai.samples.indexer.parser.Page;
import com.microsoft.openai.samples.indexer.parser.TextSplitter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;

/**
* The DocumentProcessor class is responsible for processing and indexing documents.
* It takes a document as input, either as a file or as a byte array, and processes it for indexing.
Expand Down Expand Up @@ -47,6 +46,7 @@ public void indexDocumentfromFile(String filepath, String category) throws IOExc

public void indexDocumentFromBytes(String filename, String category, byte[] content){
logger.debug("Indexing file {}", filename);

//TODO add support for other file types (docx, pptx, txt, md, html, etc)
List<Page> pages = pdfParser.parse(content);
logger.info("Found {} pages in file {}", pages.size(), filename);
Expand Down
5 changes: 3 additions & 2 deletions deploy/aca/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ param chatGptDeploymentCapacity int = 60
param chatGptModelName string = 'gpt-35-turbo'
param chatGptModelVersion string = '0613'
param embeddingDeploymentName string // Set in main.parameters.json
param embeddingDeploymentCapacity int = 80
param embeddingDeploymentCapacity int = 60
param chatGptDeploymentSkuName string= 'Standard'
param embeddingModelName string = 'text-embedding-ada-002'

param servicebusNamespace string = ''
Expand Down Expand Up @@ -307,7 +308,7 @@ module openAi '../../shared/ai/cognitiveservices.bicep' = {
version: chatGptModelVersion
}
sku: {
name: 'Standard'
name: chatGptDeploymentSkuName
capacity: chatGptDeploymentCapacity
}
}
Expand Down
6 changes: 6 additions & 0 deletions deploy/aca/infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
"chatGptDeploymentName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
},
"chatGptDeploymentCapacity": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY=60}"
},
"chatGptDeploymentSkuName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU_NAME=Standard}"
},
"embeddingDeploymentName": {
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
},
Expand Down
3 changes: 2 additions & 1 deletion deploy/aks/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ param chatGptModelName string = 'gpt-35-turbo'
param chatGptModelVersion string = '0613'
param embeddingDeploymentName string // Set in main.parameters.json
param embeddingDeploymentCapacity int = 80
param chatGptDeploymentSkuName string= 'Standard'
param embeddingModelName string = 'text-embedding-ada-002'

param servicebusNamespace string = ''
Expand Down Expand Up @@ -177,7 +178,7 @@ module openAi '../../shared/ai/cognitiveservices.bicep' = if (openAiHost == 'azu
version: chatGptModelVersion
}
sku: {
name: 'Standard'
name: chatGptDeploymentSkuName
capacity: chatGptDeploymentCapacity
}
}
Expand Down
6 changes: 6 additions & 0 deletions deploy/aks/infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
"chatGptDeploymentName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
},
"chatGptDeploymentCapacity": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY=60}"
},
"chatGptDeploymentSkuName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU_NAME=Standard}"
},
"embeddingDeploymentName": {
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
},
Expand Down
3 changes: 2 additions & 1 deletion deploy/app-service/infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ param formRecognizerSkuName string = 'S0'

param chatGptDeploymentName string // Set in main.parameters.json
param chatGptDeploymentCapacity int = 60
param chatGptDeploymentSkuName string= 'Standard'
param chatGptModelName string = 'gpt-35-turbo'
param chatGptModelVersion string = '0613'
param embeddingDeploymentName string // Set in main.parameters.json
Expand Down Expand Up @@ -238,7 +239,7 @@ module openAi '../../shared/ai/cognitiveservices.bicep' = if (openAiHost == 'azu
version: chatGptModelVersion
}
sku: {
name: 'Standard'
name: chatGptDeploymentSkuName
capacity: chatGptDeploymentCapacity
}
}
Expand Down
6 changes: 6 additions & 0 deletions deploy/app-service/infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
"chatGptDeploymentName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT=chat}"
},
"chatGptDeploymentCapacity": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY=60}"
},
"chatGptDeploymentSkuName": {
"value": "${AZURE_OPENAI_CHATGPT_DEPLOYMENT_SKU_NAME=Standard}"
},
"embeddingDeploymentName": {
"value": "${AZURE_OPENAI_EMB_DEPLOYMENT=embedding}"
},
Expand Down

0 comments on commit dd65092

Please sign in to comment.