Skip to content

feat: Remove AI search service for PostgreSQL configuration to optimize deployment #1624

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

Merged
merged 1 commit into from
Jan 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ def __init__(self) -> None:
self.message_id = str(uuid4())
self.tokens = {"prompt": 0, "completion": 0, "total": 0}
logger.debug(f"New message id: {self.message_id} with tokens {self.tokens}")
self.conversation_logger: ConversationLogger = ConversationLogger()
if str(self.config.logging.log_user_interactions).lower() == "true":
self.conversation_logger: ConversationLogger = ConversationLogger()
self.content_safety_checker = ContentSafetyChecker()
self.output_parser = OutputParserTool()

Expand Down
20 changes: 11 additions & 9 deletions infra/app/adminweb.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,17 @@ module adminweb '../core/host/appservice.bicep' = {
).key1
AZURE_SEARCH_KEY: useKeyVault
? searchKeyName
: listAdminKeys(
resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.Search/searchServices',
azureAISearchName
),
'2021-04-01-preview'
).primaryKey
: (azureAISearchName != ''
? listAdminKeys(
resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.Search/searchServices',
azureAISearchName
),
'2021-04-01-preview'
).primaryKey
: '')
AZURE_BLOB_ACCOUNT_KEY: useKeyVault
? storageAccountKeyName
: listKeys(
Expand Down
20 changes: 11 additions & 9 deletions infra/app/function.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ module function '../core/host/functions.bicep' = {
).key1
AZURE_SEARCH_KEY: useKeyVault
? searchKeyName
: listAdminKeys(
resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.Search/searchServices',
azureAISearchName
),
'2021-04-01-preview'
).primaryKey
: (azureAISearchName != ''
? listAdminKeys(
resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.Search/searchServices',
azureAISearchName
),
'2021-04-01-preview'
).primaryKey
: '')
AZURE_BLOB_ACCOUNT_KEY: useKeyVault
? storageAccountKeyName
: listKeys(
Expand Down
11 changes: 8 additions & 3 deletions infra/app/machinelearning.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ resource machineLearningWorkspace 'Microsoft.MachineLearningServices/workspaces@
}
}

resource aisearch_connection 'Microsoft.MachineLearningServices/workspaces/connections@2024-01-01-preview' = {
resource aisearch_connection 'Microsoft.MachineLearningServices/workspaces/connections@2024-01-01-preview' = if (azureAISearchName != '') {
parent: machineLearningWorkspace
name: 'aisearch_connection'
properties: {
Expand All @@ -42,7 +42,12 @@ resource aisearch_connection 'Microsoft.MachineLearningServices/workspaces/conne
}
}

var azureOpenAIId = resourceId(subscription().subscriptionId, resourceGroup().name, 'Microsoft.CognitiveServices/accounts', azureOpenAIName)
var azureOpenAIId = resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.CognitiveServices/accounts',
azureOpenAIName
)

resource openai_connection 'Microsoft.MachineLearningServices/workspaces/connections@2024-01-01-preview' = {
parent: machineLearningWorkspace
Expand All @@ -61,4 +66,4 @@ resource openai_connection 'Microsoft.MachineLearningServices/workspaces/connect
}
}

output workspaceName string = machineLearningWorkspace.name
output workspaceName string = machineLearningWorkspace.name
4 changes: 2 additions & 2 deletions infra/app/storekeys.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resource openAIKeySecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = {
}
}

resource searchKeySecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = {
resource searchKeySecret 'Microsoft.KeyVault/vaults/secrets@2022-07-01' = if (azureAISearchName != '') {
parent: keyVault
name: searchKeyName
properties: {
Expand Down Expand Up @@ -135,7 +135,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {

output CONTENT_SAFETY_KEY_NAME string = contentSafetyKeySecret.name
output FORM_RECOGNIZER_KEY_NAME string = formRecognizerKeySecret.name
output SEARCH_KEY_NAME string = searchKeySecret.name
output SEARCH_KEY_NAME string = azureAISearchName != '' ? searchKeySecret.name : ''
output OPENAI_KEY_NAME string = openAIKeySecret.name
output STORAGE_ACCOUNT_KEY_NAME string = storageAccountKeySecret.name
output SPEECH_KEY_NAME string = speechKeySecret.name
Expand Down
20 changes: 11 additions & 9 deletions infra/app/web.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,17 @@ module web '../core/host/appservice.bicep' = {
).key1
AZURE_SEARCH_KEY: useKeyVault
? searchKeyName
: listAdminKeys(
resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.Search/searchServices',
azureAISearchName
),
'2021-04-01-preview'
).primaryKey
: (azureAISearchName != ''
? listAdminKeys(
resourceId(
subscription().subscriptionId,
resourceGroup().name,
'Microsoft.Search/searchServices',
azureAISearchName
),
'2021-04-01-preview'
).primaryKey
: '')
AZURE_BLOB_ACCOUNT_KEY: useKeyVault
? storageAccountKeyName
: listKeys(
Expand Down
Loading
Loading