Skip to content

Commit 25ac736

Browse files
authored
Merge pull request #44 from john0isaac/update-packages
update the semantic kernel
2 parents 8f0d242 + 65652ee commit 25ac736

File tree

11 files changed

+304
-163
lines changed

11 files changed

+304
-163
lines changed

.env.example

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
OPENAI_API_TYPE="azure"
2+
OPENAI_API_VERSION="2024-10-01-preview"
13
# Environment variables obtained from Azure OpenAI
4+
AZURE_OPENAI_CHAT_MODEL_NAME="gpt-35-turbo"
25
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=""
6+
AZURE_OPENAI_EMBEDDINGS_MODEL_NAME="text-embedding-ada-002"
37
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME=""
48
AZURE_OPENAI_DEPLOYMENT_NAME=""
5-
AZURE_OPENAI_ENDPOINT=""
9+
AZURE_OPENAI_ENDPOINT="https://<YOUR-OPENAI-DEPLOYMENT-NAME>.openai.azure.com/"
610
AZURE_OPENAI_API_KEY=""
711
# Environment variable obtained from Azure Cosmos DB for MongoDB vCore
8-
AZCOSMOS_CONNSTR=""
12+
AZURE_COSMOS_CONNECTION_STRING="<YOUR-COSMOS-DB-CONNECTION-STRING>"
13+
AZURE_COSMOS_USERNAME="<YOUR-COSMOS-DB-USERNAME>"
14+
AZURE_COSMOS_PASSWORD="<YOUR-COSMOS-DB-PASSWORD>"
915
# Environment variables you set to be used by the code
10-
AZCOSMOS_DATABASE_NAME=""
11-
AZCOSMOS_CONTAINER_NAME=""
16+
AZURE_COSMOS_DATABASE_NAME="<COSMOS-DB-NEW-UNIQUE-DATABASE-NAME>"
17+
AZURE_COSMOS_COLLECTION_NAME="<COSMOS-DB-NEW-UNIQUE-COLLECTION-NAME>"
18+
AZURE_COSMOS_INDEX_NAME="VectorSearchIndex"

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"**/__pycache__": true,
1616
"**/.ruff_cache": true,
1717
"**/.mypy_cache": true,
18-
"**/.venv": true,
1918
},
2019
"search.exclude": {
2120
"**/.venv": true,

infra/main.bicep

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ param location string
1111
@description('Id of the user or app to assign application roles')
1212
param principalId string = ''
1313

14+
@description('SKU to use for App Service Plan')
15+
param appServiceSku string
16+
1417
var mongoClusterName = '${uniqueString(resourceGroup.id)}-mvcore'
1518
var mongoAdminUser = 'admin${uniqueString(resourceGroup.id)}'
1619
@secure()
1720
@description('Mongo Server administrator password')
1821
param mongoAdminPassword string
1922

23+
@description('SKU to use for Cosmos DB for MongoDB vCore Plan')
24+
param mongoServiceSku string
25+
2026
param openAIDeploymentName string = '${name}-openai'
2127
param chatGptDeploymentName string = 'chat-gpt'
2228
param chatGptDeploymentCapacity int = 30
@@ -109,7 +115,7 @@ module appServicePlan 'core/host/appserviceplan.bicep' = {
109115
location: location
110116
tags: tags
111117
sku: {
112-
name: 'B1'
118+
name: appServiceSku
113119
}
114120
reserved: true
115121
}
@@ -126,19 +132,19 @@ module mongoCluster 'core/database/cosmos/mongo/cosmos-mongo-cluster.bicep' = {
126132
administratorLoginPassword: mongoAdminPassword
127133
storage: 32
128134
nodeCount: 1
129-
sku: 'M25'
135+
sku: mongoServiceSku
130136
allowAzureIPsFirewall: true
131137
}
132138
}
133139

134140
module keyVaultSecrets './core/security/keyvault-secret.bicep' = {
135141
dependsOn: [ mongoCluster ]
136-
name: 'keyvault-secret-mongo-connstr'
142+
name: 'keyvault-secret-mongo-password'
137143
scope: resourceGroup
138144
params: {
139-
name: 'mongoConnectionStr'
145+
name: 'mongoAdminPassword'
140146
keyVaultName: keyVault.outputs.name
141-
secretValue: replace(replace(mongoCluster.outputs.connectionStringKey, '<user>', mongoAdminUser), '<password>', mongoAdminPassword)
147+
secretValue: mongoAdminPassword
142148
}
143149
}
144150

@@ -157,15 +163,20 @@ module web 'core/host/appservice.bicep' = {
157163
scmDoBuildDuringDeployment: true
158164
ftpsState: 'Disabled'
159165
managedIdentity: true
166+
use32BitWorkerProcess: appServiceSku == 'F1'
167+
alwaysOn: appServiceSku != 'F1'
160168
appSettings: {
161169
AZURE_OPENAI_DEPLOYMENT_NAME: openAIDeploymentName
162170
AZURE_OPENAI_ENDPOINT: openAi.outputs.endpoint
163171
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME: chatGptDeploymentName
164172
AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT_NAME: embeddingDeploymentName
165173
AZURE_OPENAI_API_KEY: '@Microsoft.KeyVault(VaultName=${keyVault.outputs.name};SecretName=cognitiveServiceKey)'
166-
AZCOSMOS_CONNSTR: '@Microsoft.KeyVault(VaultName=${keyVault.outputs.name};SecretName=mongoConnectionStr)'
167-
AZCOSMOS_DATABASE_NAME: 'sk_database'
168-
AZCOSMOS_CONTAINER_NAME: 'sk_collection'
174+
AZURE_COSMOS_PASSWORD: '@Microsoft.KeyVault(VaultName=${keyVault.outputs.name};SecretName=mongoAdminPassword)'
175+
AZURE_COSMOS_CONNECTION_STRING: mongoCluster.outputs.connectionStringKey
176+
AZURE_COSMOS_USERNAME: mongoAdminUser
177+
AZURE_COSMOS_DATABASE_NAME: 'sk_database'
178+
AZURE_COSMOS_COLLECTION_NAME: 'sk_collection'
179+
AZURE_COSMOS_INDEX_NAME: 'sk_index'
169180
}
170181
}
171182
}

infra/main.parameters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
},
1414
"mongoAdminPassword": {
1515
"value": "$(secretOrRandomPassword ${AZURE_KEY_VAULT_NAME} mongoAdminPassword)"
16+
},
17+
"appServiceSku": {
18+
"value": "${AZURE_APP_SERVICE_SKU=B1}"
19+
},
20+
"mongoServiceSku":{
21+
"value": "${AZURE_MONGO_SERVICE_SKU=M25}"
1622
}
1723
}
1824
}

0 commit comments

Comments
 (0)