Skip to content

Commit

Permalink
Merge pull request #13 from pamelafox/upgrade-openai
Browse files Browse the repository at this point in the history
Upgrade OpenAI to latest Bicep schema
  • Loading branch information
pamelafox authored Jun 15, 2023
2 parents 7b7d14b + a925aa5 commit b498a33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 7 additions & 4 deletions infra/core/ai/cognitiveservices.bicep
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
param name string
param location string = resourceGroup().location
param tags object = {}
@description('The custom subdomain name used to access the API. Defaults to the value of the name parameter.')

param customSubDomainName string = name
param deployments array = []
param kind string = 'OpenAI'
Expand All @@ -10,7 +10,7 @@ param sku object = {
name: 'S0'
}

resource account 'Microsoft.CognitiveServices/accounts@2022-10-01' = {
resource account 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: name
location: location
tags: tags
Expand All @@ -23,13 +23,16 @@ resource account 'Microsoft.CognitiveServices/accounts@2022-10-01' = {
}

@batchSize(1)
resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2022-10-01' = [for deployment in deployments: {
resource deployment 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = [for deployment in deployments: {
parent: account
name: deployment.name
properties: {
model: deployment.model
raiPolicyName: contains(deployment, 'raiPolicyName') ? deployment.raiPolicyName : null
scaleSettings: deployment.scaleSettings
}
sku: {
name: 'Standard'
capacity: deployment.capacity
}
}]

Expand Down
5 changes: 2 additions & 3 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ param openAiResourceName string = ''
param openAiResourceGroupName string = ''
param openAiResourceGroupLocation string = ''
param openAiSkuName string = ''
param openAiDeploymentCapacity int = 30

var resourceToken = toLower(uniqueString(subscription().id, name, location))
var tags = { 'azd-env-name': name }
Expand Down Expand Up @@ -53,9 +54,7 @@ module openAi 'core/ai/cognitiveservices.bicep' = {
name: 'gpt-35-turbo'
version: '0301'
}
scaleSettings: {
scaleType: 'Standard'
}
capacity: openAiDeploymentCapacity
}
]
}
Expand Down

0 comments on commit b498a33

Please sign in to comment.