Skip to content

Commit

Permalink
Update settings / deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
crickman committed Nov 8, 2023
1 parent 2da82fa commit 2fb08f8
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 104 deletions.
4 changes: 2 additions & 2 deletions memorypipeline/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
//
// Semantic Memory configuration - https://github.com/microsoft/semantic-memory
// Kernel Memory configuration - https://github.com/microsoft/kernel-memory
// - ContentStorageType is the storage configuration for memory transfer: "AzureBlobs" or "SimpleFileStorage"
// - TextGeneratorType is the AI completion service configuration: "AzureOpenAIText" or "OpenAI"
// - ImageOcrType is the image OCR configuration: "None" or "AzureFormRecognizer" or "Tesseract"
// - DataIngestion is the configuration section for data ingestion pipelines.
// - Retrieval is the configuration section for memory retrieval.
// - Services is the configuration sections for various memory settings.
//
"SemanticMemory": {
"KernelMemory": {
"ContentStorageType": "SimpleFileStorage",
"TextGeneratorType": "AzureOpenAIText",
"ImageOcrType": "None",
Expand Down
8 changes: 4 additions & 4 deletions scripts/Configure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ $webapiProjectPath = Join-Path "$PSScriptRoot" '../webapi'

Write-Host "Setting 'APIKey' user secret for $AIService..."
if ($AIService -eq $varOpenAI) {
dotnet user-secrets set --project $webapiProjectPath SemanticMemory:Services:OpenAI:APIKey $ApiKey
dotnet user-secrets set --project $webapiProjectPath KernelMemory:Services:OpenAI:APIKey $ApiKey
if ($LASTEXITCODE -ne 0) { exit(1) }
$AIServiceOverrides = @{
OpenAI = @{
Expand All @@ -151,9 +151,9 @@ if ($AIService -eq $varOpenAI) {
};
}
else {
dotnet user-secrets set --project $webapiProjectPath SemanticMemory:Services:AzureOpenAIText:APIKey $ApiKey
dotnet user-secrets set --project $webapiProjectPath KernelMemory:Services:AzureOpenAIText:APIKey $ApiKey
if ($LASTEXITCODE -ne 0) { exit(1) }
dotnet user-secrets set --project $webapiProjectPath SemanticMemory:Services:AzureOpenAIEmbedding:APIKey $ApiKey
dotnet user-secrets set --project $webapiProjectPath KernelMemory:Services:AzureOpenAIEmbedding:APIKey $ApiKey
if ($LASTEXITCODE -ne 0) { exit(1) }
$AIServiceOverrides = @{
AzureOpenAIText = @{
Expand All @@ -180,7 +180,7 @@ $appsettingsOverrides = @{
Planner = @{
Model = $PlannerModel
};
SemanticMemory = @{
KernelMemory = @{
TextGeneratorType = $AIService;
DataIngestion = @{
EmbeddingGeneratorTypes = @($AIService)
Expand Down
8 changes: 4 additions & 4 deletions scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ WEBAPI_PROJECT_PATH="${SCRIPT_DIRECTORY}/../webapi"

echo "Setting 'APIKey' user secret for $AI_SERVICE..."
if [ "$AI_SERVICE" = "$ENV_OPEN_AI" ]; then
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH SemanticMemory:Services:OpenAI:APIKey $API_KEY
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH KernelMemory:Services:OpenAI:APIKey $API_KEY
if [ $? -ne 0 ]; then exit 1; fi
AISERVICE_OVERRIDES="{
\"OpenAI\":
Expand All @@ -168,9 +168,9 @@ if [ "$AI_SERVICE" = "$ENV_OPEN_AI" ]; then
}
}"
else
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH SemanticMemory:Services:AzureOpenAIText:APIKey $API_KEY
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH KernelMemory:Services:AzureOpenAIText:APIKey $API_KEY
if [ $? -ne 0 ]; then exit 1; fi
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH SemanticMemory:Services:AzureOpenAIEmbedding:APIKey $API_KEY
dotnet user-secrets set --project $WEBAPI_PROJECT_PATH KernelMemory:Services:AzureOpenAIEmbedding:APIKey $API_KEY
if [ $? -ne 0 ]; then exit 1; fi
AISERVICE_OVERRIDES="{
\"AzureOpenAIText\": {
Expand All @@ -197,7 +197,7 @@ APPSETTINGS_OVERRIDES="{
\"Planner\": {
\"Model\": \"${PLANNER_MODEL}\"
},
\"SemanticMemory\": {
\"KernelMemory\": {
\"TextGeneratorType\": \"${AI_SERVICE}\",
\"DataIngestion\": {
\"EmbeddingGeneratorTypes\": [\"${AI_SERVICE}\"]
Expand Down
120 changes: 60 additions & 60 deletions scripts/deploy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -288,115 +288,115 @@ resource appServiceWebConfig 'Microsoft.Web/sites/config@2022-09-01' = {
value: '~2'
}
{
name: 'SemanticMemory:ContentStorageType'
name: 'KernelMemory:ContentStorageType'
value: 'AzureBlobs'
}
{
name: 'SemanticMemory:TextGeneratorType'
name: 'KernelMemory:TextGeneratorType'
value: aiService
}
{
name: 'SemanticMemory:DataIngestion:OrchestrationType'
name: 'KernelMemory:DataIngestion:OrchestrationType'
value: 'Distributed'
}
{
name: 'SemanticMemory:DataIngestion:DistributedOrchestration:QueueType'
name: 'KernelMemory:DataIngestion:DistributedOrchestration:QueueType'
value: 'AzureQueue'
}
{
name: 'SemanticMemory:DataIngestion:EmbeddingGeneratorTypes:0'
name: 'KernelMemory:DataIngestion:EmbeddingGeneratorTypes:0'
value: aiService
}
{
name: 'SemanticMemory:DataIngestion:VectorDbTypes:0'
name: 'KernelMemory:DataIngestion:VectorDbTypes:0'
value: memoryStore
}
{
name: 'SemanticMemory:Retrieval:VectorDbType'
name: 'KernelMemory:Retrieval:VectorDbType'
value: memoryStore
}
{
name: 'SemanticMemory:Retrieval:EmbeddingGeneratorType'
name: 'KernelMemory:Retrieval:EmbeddingGeneratorType'
value: aiService
}
{
name: 'SemanticMemory:Services:AzureBlobs:Auth'
name: 'KernelMemory:Services:AzureBlobs:Auth'
value: 'ConnectionString'
}
{
name: 'SemanticMemory:Services:AzureBlobs:ConnectionString'
name: 'KernelMemory:Services:AzureBlobs:ConnectionString'
value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[1].value}'
}
{
name: 'SemanticMemory:Services:AzureBlobs:Container'
name: 'KernelMemory:Services:AzureBlobs:Container'
value: 'chatmemory'
}
{
name: 'SemanticMemory:Services:AzureQueue:Auth'
name: 'KernelMemory:Services:AzureQueue:Auth'
value: 'ConnectionString'
}
{
name: 'SemanticMemory:Services:AzureQueue:ConnectionString'
name: 'KernelMemory:Services:AzureQueue:ConnectionString'
value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[1].value}'
}
{
name: 'SemanticMemory:Services:AzureCognitiveSearch:Auth'
name: 'KernelMemory:Services:AzureCognitiveSearch:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureCognitiveSearch:Endpoint'
name: 'KernelMemory:Services:AzureCognitiveSearch:Endpoint'
value: memoryStore == 'AzureCognitiveSearch' ? 'https://${azureCognitiveSearch.name}.search.windows.net' : ''
}
{
name: 'SemanticMemory:Services:AzureCognitiveSearch:APIKey'
name: 'KernelMemory:Services:AzureCognitiveSearch:APIKey'
value: memoryStore == 'AzureCognitiveSearch' ? azureCognitiveSearch.listAdminKeys().primaryKey : ''
}
{
name: 'SemanticMemory:Services:Qdrant:Endpoint'
name: 'KernelMemory:Services:Qdrant:Endpoint'
value: memoryStore == 'Qdrant' ? 'https://${appServiceQdrant.properties.defaultHostName}' : ''
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:Auth'
name: 'KernelMemory:Services:AzureOpenAIText:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:Endpoint'
name: 'KernelMemory:Services:AzureOpenAIText:Endpoint'
value: deployNewAzureOpenAI ? openAI.properties.endpoint : aiEndpoint
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:APIKey'
name: 'KernelMemory:Services:AzureOpenAIText:APIKey'
value: deployNewAzureOpenAI ? openAI.listKeys().key1 : aiApiKey
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:Deployment'
name: 'KernelMemory:Services:AzureOpenAIText:Deployment'
value: completionModel
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:Auth'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:Endpoint'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:Endpoint'
value: deployNewAzureOpenAI ? openAI.properties.endpoint : aiEndpoint
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:APIKey'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:APIKey'
value: deployNewAzureOpenAI ? openAI.listKeys().key1 : aiApiKey
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:Deployment'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:Deployment'
value: embeddingModel
}
{
name: 'SemanticMemory:Services:OpenAI:TextModel'
name: 'KernelMemory:Services:OpenAI:TextModel'
value: completionModel
}
{
name: 'SemanticMemory:Services:OpenAI:EmbeddingModel'
name: 'KernelMemory:Services:OpenAI:EmbeddingModel'
value: embeddingModel
}
{
name: 'SemanticMemory:Services:OpenAI:APIKey'
name: 'KernelMemory:Services:OpenAI:APIKey'
value: aiApiKey
}
{
Expand Down Expand Up @@ -467,131 +467,131 @@ resource appServiceMemoryPipelineConfig 'Microsoft.Web/sites/config@2022-09-01'
vnetRouteAllEnabled: true
appSettings: [
{
name: 'SemanticMemory:ContentStorageType'
name: 'KernelMemory:ContentStorageType'
value: 'AzureBlobs'
}
{
name: 'SemanticMemory:TextGeneratorType'
name: 'KernelMemory:TextGeneratorType'
value: aiService
}
{
name: 'SemanticMemory:ImageOcrType'
name: 'KernelMemory:ImageOcrType'
value: 'AzureFormRecognizer'
}
{
name: 'SemanticMemory:DataIngestion:OrchestrationType'
name: 'KernelMemory:DataIngestion:OrchestrationType'
value: 'Distributed'
}
{
name: 'SemanticMemory:DataIngestion:DistributedOrchestration:QueueType'
name: 'KernelMemory:DataIngestion:DistributedOrchestration:QueueType'
value: 'AzureQueue'
}
{
name: 'SemanticMemory:DataIngestion:EmbeddingGeneratorTypes:0'
name: 'KernelMemory:DataIngestion:EmbeddingGeneratorTypes:0'
value: aiService
}
{
name: 'SemanticMemory:DataIngestion:VectorDbTypes:0'
name: 'KernelMemory:DataIngestion:VectorDbTypes:0'
value: memoryStore
}
{
name: 'SemanticMemory:Retrieval:VectorDbType'
name: 'KernelMemory:Retrieval:VectorDbType'
value: memoryStore
}
{
name: 'SemanticMemory:Retrieval:EmbeddingGeneratorType'
name: 'KernelMemory:Retrieval:EmbeddingGeneratorType'
value: aiService
}
{
name: 'SemanticMemory:Services:AzureBlobs:Auth'
name: 'KernelMemory:Services:AzureBlobs:Auth'
value: 'ConnectionString'
}
{
name: 'SemanticMemory:Services:AzureBlobs:ConnectionString'
name: 'KernelMemory:Services:AzureBlobs:ConnectionString'
value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[1].value}'
}
{
name: 'SemanticMemory:Services:AzureBlobs:Container'
name: 'KernelMemory:Services:AzureBlobs:Container'
value: 'chatmemory'
}
{
name: 'SemanticMemory:Services:AzureQueue:Auth'
name: 'KernelMemory:Services:AzureQueue:Auth'
value: 'ConnectionString'
}
{
name: 'SemanticMemory:Services:AzureQueue:ConnectionString'
name: 'KernelMemory:Services:AzureQueue:ConnectionString'
value: 'DefaultEndpointsProtocol=https;AccountName=${storage.name};AccountKey=${storage.listKeys().keys[1].value}'
}
{
name: 'SemanticMemory:Services:AzureCognitiveSearch:Auth'
name: 'KernelMemory:Services:AzureCognitiveSearch:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureCognitiveSearch:Endpoint'
name: 'KernelMemory:Services:AzureCognitiveSearch:Endpoint'
value: memoryStore == 'AzureCognitiveSearch' ? 'https://${azureCognitiveSearch.name}.search.windows.net' : ''
}
{
name: 'SemanticMemory:Services:AzureCognitiveSearch:APIKey'
name: 'KernelMemory:Services:AzureCognitiveSearch:APIKey'
value: memoryStore == 'AzureCognitiveSearch' ? azureCognitiveSearch.listAdminKeys().primaryKey : ''
}
{
name: 'SemanticMemory:Services:Qdrant:Endpoint'
name: 'KernelMemory:Services:Qdrant:Endpoint'
value: memoryStore == 'Qdrant' ? 'https://${appServiceQdrant.properties.defaultHostName}' : ''
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:Auth'
name: 'KernelMemory:Services:AzureOpenAIText:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:Endpoint'
name: 'KernelMemory:Services:AzureOpenAIText:Endpoint'
value: deployNewAzureOpenAI ? openAI.properties.endpoint : aiEndpoint
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:APIKey'
name: 'KernelMemory:Services:AzureOpenAIText:APIKey'
value: deployNewAzureOpenAI ? openAI.listKeys().key1 : aiApiKey
}
{
name: 'SemanticMemory:Services:AzureOpenAIText:Deployment'
name: 'KernelMemory:Services:AzureOpenAIText:Deployment'
value: completionModel
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:Auth'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:Endpoint'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:Endpoint'
value: deployNewAzureOpenAI ? openAI.properties.endpoint : aiEndpoint
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:APIKey'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:APIKey'
value: deployNewAzureOpenAI ? openAI.listKeys().key1 : aiApiKey
}
{
name: 'SemanticMemory:Services:AzureOpenAIEmbedding:Deployment'
name: 'KernelMemory:Services:AzureOpenAIEmbedding:Deployment'
value: embeddingModel
}
{
name: 'SemanticMemory:Services:AzureFormRecognizer:Auth'
name: 'KernelMemory:Services:AzureFormRecognizer:Auth'
value: 'ApiKey'
}
{
name: 'SemanticMemory:Services:AzureFormRecognizer:Endpoint'
name: 'KernelMemory:Services:AzureFormRecognizer:Endpoint'
value: ocrAccount.properties.endpoint
}
{
name: 'SemanticMemory:Services:AzureFormRecognizer:APIKey'
name: 'KernelMemory:Services:AzureFormRecognizer:APIKey'
value: ocrAccount.listKeys().key1
}
{
name: 'SemanticMemory:Services:OpenAI:TextModel'
name: 'KernelMemory:Services:OpenAI:TextModel'
value: completionModel
}
{
name: 'SemanticMemory:Services:OpenAI:EmbeddingModel'
name: 'KernelMemory:Services:OpenAI:EmbeddingModel'
value: embeddingModel
}
{
name: 'SemanticMemory:Services:OpenAI:APIKey'
name: 'KernelMemory:Services:OpenAI:APIKey'
value: aiApiKey
}
{
Expand Down
Loading

0 comments on commit 2fb08f8

Please sign in to comment.