Skip to content

Commit

Permalink
Fix for cognitive services API version (#508)
Browse files Browse the repository at this point in the history
### Motivation and Context

Fix for issue #425 

The older API version was no longer working. It allows for deploying a
new Azure OpenAI resource.

### Description

Updates the API version and SKU of the Azure OpenAI 

### Contribution Checklist

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Gil LaHaye <[email protected]>
  • Loading branch information
Dag-Calafell-MCA and glahaye authored Oct 18, 2023
1 parent 8924709 commit b0801da
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
20 changes: 11 additions & 9 deletions scripts/deploy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var uniqueName = '${name}-${rgIdHash}'
@description('Name of the Azure Storage file share to create')
var storageFileShareName = 'aciqdrantshare'

resource openAI 'Microsoft.CognitiveServices/accounts@2022-12-01' = if (deployNewAzureOpenAI) {
resource openAI 'Microsoft.CognitiveServices/accounts@2023-05-01' = if (deployNewAzureOpenAI) {
name: 'ai-${uniqueName}'
location: location
kind: 'OpenAI'
Expand All @@ -105,31 +105,33 @@ resource openAI 'Microsoft.CognitiveServices/accounts@2022-12-01' = if (deployNe
}
}

resource openAI_completionModel 'Microsoft.CognitiveServices/accounts/deployments@2022-12-01' = if (deployNewAzureOpenAI) {
resource openAI_completionModel 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = if (deployNewAzureOpenAI) {
parent: openAI
name: completionModel
sku: {
name: 'Standard'
capacity: 30
}
properties: {
model: {
format: 'OpenAI'
name: completionModel
}
scaleSettings: {
scaleType: 'Standard'
}
}
}

resource openAI_embeddingModel 'Microsoft.CognitiveServices/accounts/deployments@2022-12-01' = if (deployNewAzureOpenAI) {
resource openAI_embeddingModel 'Microsoft.CognitiveServices/accounts/deployments@2023-05-01' = if (deployNewAzureOpenAI) {
parent: openAI
name: embeddingModel
sku: {
name: 'Standard'
capacity: 30
}
properties: {
model: {
format: 'OpenAI'
name: embeddingModel
}
scaleSettings: {
scaleType: 'Standard'
}
}
dependsOn: [// This "dependency" is to create models sequentially because the resource
openAI_completionModel // provider does not support parallel creation of models properly.
Expand Down
Loading

0 comments on commit b0801da

Please sign in to comment.