Skip to content

Commit 8224a85

Browse files
authored
Update cogservices to support new RP API (Azure-Samples#114)
The cognitive services API changed. We need this update to support it.
1 parent 21ee9ff commit 8224a85

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

infra/core/ai/cognitiveservices.bicep

+6-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ param sku object = {
1010
name: 'S0'
1111
}
1212

13-
resource account 'Microsoft.CognitiveServices/accounts@2022-10-01' = {
13+
resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
1414
name: name
1515
location: location
1616
tags: tags
@@ -23,13 +23,16 @@ resource account 'Microsoft.CognitiveServices/accounts@2022-10-01' = {
2323
}
2424

2525
@batchSize(1)
26-
resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2022-10-01' = [for deployment in deployments: {
26+
resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for deployment in deployments: {
2727
parent: account
2828
name: deployment.name
2929
properties: {
3030
model: deployment.model
3131
raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null
32-
scaleSettings: deployment.scaleSettings
32+
}
33+
sku: contains(deployment, 'sku') ? deployment.sku : {
34+
name: 'Standard'
35+
capacity: 20
3336
}
3437
}]
3538

infra/main.bicep

+12-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ param applicationInsightsDashboardName string = ''
1515
@description('Name of the Azure Application Insights resource')
1616
param applicationInsightsName string = ''
1717

18+
@description('Capacity of the chat GPT deployment. Default: 30')
19+
param chatGptDeploymentCapacity int = 30
20+
1821
@description('Name of the chat GPT deployment')
1922
param chatGptDeploymentName string = 'chat'
2023

@@ -42,6 +45,9 @@ param formRecognizerServiceName string = ''
4245
@description('SKU name for the Form Recognizer service. Default: S0')
4346
param formRecognizerSkuName string = 'S0'
4447

48+
@description('Capacity of the GPT deployment. Default: 30')
49+
param gptDeploymentCapacity int = 30
50+
4551
@description('Name of the GPT deployment. Default: davinci')
4652
param gptDeploymentName string = 'davinci'
4753

@@ -292,8 +298,9 @@ module openAi 'core/ai/cognitiveservices.bicep' = {
292298
name: gptModelName
293299
version: '1'
294300
}
295-
scaleSettings: {
296-
scaleType: 'Standard'
301+
sku: {
302+
name: 'Standard'
303+
capacity: gptDeploymentCapacity
297304
}
298305
}
299306
{
@@ -303,8 +310,9 @@ module openAi 'core/ai/cognitiveservices.bicep' = {
303310
name: chatGptModelName
304311
version: '0301'
305312
}
306-
scaleSettings: {
307-
scaleType: 'Standard'
313+
sku: {
314+
name: 'Standard'
315+
capacity: chatGptDeploymentCapacity
308316
}
309317
}
310318
]

0 commit comments

Comments
 (0)