Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for default selection with azd up #247

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ A related option is to use VS Code Dev Containers, which will open the project i
- Create a new folder `contoso-chat` and `cd` into it
- Run this command to download project template. Note that this command will initialize a git repository, so you do not need to clone this repository.
```bash
azd init -t contoso-chat-openai-prompty
azd init -t contoso-chat
```
1. **Install dependencies** for the project, manually. Note that this is done for you automatically if you use the dev container options above.
```bash
Expand Down
28 changes: 14 additions & 14 deletions infra/ai.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# yaml-language-server: $schema=ai.yaml.json

deployments:
- name: gpt-35-turbo
- name: gpt-4o-mini
model:
format: OpenAI
name: gpt-35-turbo
version: "0613"
name: gpt-4o-mini
version: "2024-07-18"
sku:
name: Standard
capacity: 20
name: GlobalStandard
capacity: 30
- name: text-embedding-ada-002
model:
format: OpenAI
name: text-embedding-ada-002
version: "2"
sku:
name: "Standard"
capacity: 20
capacity: 30
- name: gpt-4
model:
format: OpenAI
Expand All @@ -25,11 +25,11 @@ deployments:
sku:
name: "GlobalStandard"
capacity: 20
- name: gpt-4-evals
model:
format: OpenAI
name: gpt-4
version: "1106-Preview"
sku:
name: "Standard"
capacity: 8
# - name: gpt-4-evals
# model:
# format: OpenAI
# name: gpt-4
# version: "1106-Preview"
# sku:
# name: "Standard"
# capacity: 8
12 changes: 6 additions & 6 deletions infra/core/ai/hub.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ param location string = resourceGroup().location
param tags object = {}

// NN:TODO resource hub 'Microsoft.MachineLearningServices/workspaces@2024-01-01-preview' = {
resource hub 'Microsoft.MachineLearningServices/workspaces@2024-04-01' = {
resource hub 'Microsoft.MachineLearningServices/workspaces@2024-07-01-preview' = {
name: name
location: location
tags: tags
Expand Down Expand Up @@ -79,16 +79,16 @@ resource hub 'Microsoft.MachineLearningServices/workspaces@2024-04-01' = {
The ApiVersion specified in the metadata is for the Azure Cognitive Services version (that wraps the OpenAPI call)
*/

resource openAiConnection 'connections@2024-04-01-preview' = { // NN:TODO Add @version to ensure resource is correctly versioned
resource openAiConnection 'connections' = { // NN:TODO Add @version to ensure resource is correctly versioned
name: 'aoai-connection'
properties: {
category: 'AzureOpenAI'
category: 'AIServices'
authType: 'ApiKey'
isSharedToAll: true
target: openAi.properties.endpoints['OpenAI Language Model Instance API']
target: openAi.properties.endpoint
metadata: {
//ApiVersion: '2023-07-01-preview'
ApiVersion: '2024-02-01'
ApiVersion: '2023-07-01-preview'
//ApiVersion: '2024-02-01'
ApiType: 'azure'
ResourceId: openAi.id
}
Expand Down
38 changes: 20 additions & 18 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,32 @@ param environmentName string
type: 'location'
}
})
param location string

@description('The name of the resource group for the OpenAI resource')
param openAiResourceGroupName string = ''

@description('Location for the OpenAI resource')
// Limited to locations where AI foundry is available (https://learn.microsoft.com/azure/ai-studio/reference/region-support)
// Then limited to locations where semantic ranker is available (https://learn.microsoft.com/azure/search/search-region-support)
// Then limited to content safety availability (https://learn.microsoft.com/azure/ai-services/content-safety/overview)
// Look for desired models on the availability table:
// https://learn.microsoft.com/azure/ai-services/openai/concepts/models#global-standard-model-availability
@allowed([
'canadaeast'
'uksouth'
'germanywestcentral'
'francecentral'
'eastus'
'canadaeast'
'eastus2'
'francecentral'
'switzerlandnorth'
'uksouth'
'japaneast'
'koreacentral'
'northcentralus'
'australiaeast'
'swedencentral'
'southcentralus'
'switzerlandnorth'
'westeurope'
'westus'
'westus3'
])
@metadata({
azd: {
type: 'location'
}
})
param openAiResourceLocation string
param location string

@description('The name of the resource group for the OpenAI resource')
param openAiResourceGroupName string = ''

param containerRegistryName string = ''
param aiHubName string = ''
Expand Down Expand Up @@ -204,7 +206,7 @@ module aca 'app/aca.bicep' = {
identityId: managedIdentity.outputs.managedIdentityClientId
containerAppsEnvironmentName: containerApps.outputs.environmentName
containerRegistryName: containerApps.outputs.registryName
openAiDeploymentName: !empty(openAiDeploymentName) ? openAiDeploymentName : 'gpt-35-turbo'
openAiDeploymentName: !empty(openAiDeploymentName) ? openAiDeploymentName : 'gpt-4o-mini'
openAiEmbeddingDeploymentName: openAiEmbeddingDeploymentName
openAiEndpoint: ai.outputs.openAiEndpoint
openAiType: openAiType
Expand Down
23 changes: 0 additions & 23 deletions infra/main.bicepparam

This file was deleted.

17 changes: 11 additions & 6 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@
},
"location": {
"value": "${AZURE_LOCATION}"
},
"openAiResourceName": {
"value": "${AZURE_OPENAI_RESOURCE_NAME}"
},

},
"openAiApiVersion": {
"value": "${AZURE_OPENAI_API_VERSION=2023-07-01-preview}"
},
"openAiEmbeddingDeploymentName": {
"value": "${AZURE_EMBEDDING_NAME=text-embedding-ada-002}"
},
"openAiDeploymentName": {
"value": "${AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=gpt-35-turbo}"
"value": "${AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=gpt-4o-mini}"
},
"principalId": {
"value": "${AZURE_PRINCIPAL_ID}"
Expand All @@ -29,6 +25,15 @@
},
"runningOnAdo": {
"value": "${TF_BUILD}"
},
"useContainerRegistry": {
"value": "${USE_CONTAINER_REGISTRY=true}"
},
"useApplicationInsights": {
"value": "${USE_APPLICATION_INSIGHTS=true}"
},
"useSearch":{
"value": "${USE_SEARCH=true}"
}
}
}
Loading