diff --git a/.github/workflows/CAdeploy.yml b/.github/workflows/CAdeploy.yml index db65714e7..6822facb9 100644 --- a/.github/workflows/CAdeploy.yml +++ b/.github/workflows/CAdeploy.yml @@ -144,7 +144,7 @@ jobs: DEPLOY_OUTPUT=$(az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/main.bicep \ - --parameters aiDeploymentsLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} \ + --parameters aiDeploymentsLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" \ --query "properties.outputs" -o json) echo "Deployment output: $DEPLOY_OUTPUT" diff --git a/docs/TroubleShootingSteps.md b/docs/TroubleShootingSteps.md index 899be78cf..89570275e 100644 --- a/docs/TroubleShootingSteps.md +++ b/docs/TroubleShootingSteps.md @@ -309,7 +309,8 @@ The subscription 'xxxx-xxxx' cannot have more than 1 Container App Environments -
ParentResourceNotfound +
ParentResourceNotFound + - You can refer to the [Parent Resource Not found](https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-parent-resource?tabs=bicep) documentation if you encounter this error. diff --git a/infra/main.bicep b/infra/main.bicep index cc2941012..b4b74e9bb 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -158,7 +158,9 @@ var functionAppSqlPrompt = '''Generate a valid T-SQL query to find {query} for t ALWAYS select Client Name (Column: Client) in the query. Query filters are IMPORTANT. Add filters like AssetType, AssetDate, etc. if needed. When answering scheduling or time-based meeting questions, always use the StartTime column from ClientMeetings table. Use correct logic to return the most recent past meeting (last/previous) or the nearest future meeting (next/upcoming), and ensure only StartTime column is used for meeting timing comparisons. - For asset values: if question is about total \"asset value\"/\"portfolio value\"/\"AUM\" → return SUM of latest investments; if about \"current asset/investment value\" → return all latest investments without SUM. + For asset values: + - If the question is about total "asset value", "what is the asset value", "portfolio value", or "AUM" → ALWAYS return the SUM of the latest investments (do not return individual rows). + - If the question is about "current asset value" or "current investment value" → return all latest investments without SUM. Only return the generated SQL query. Do not return anything else.''' var functionAppCallTranscriptSystemPrompt = '''You are an assistant who supports wealth advisors in preparing for client meetings. @@ -177,6 +179,9 @@ param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags = var aiFoundryAiServicesAiProjectResourceName = 'proj-${solutionSuffix}' +@description('Optional created by user name') +param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0] + // ========== Resource Group Tag ========== // resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { name: 'default' @@ -184,6 +189,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { tags: { ...tags TemplateName: 'Client Advisor' + CreatedBy: createdBy } } } diff --git a/src/App/backend/agents/agent_factory.py b/src/App/backend/agents/agent_factory.py index 0e4ac3467..d219abd84 100644 --- a/src/App/backend/agents/agent_factory.py +++ b/src/App/backend/agents/agent_factory.py @@ -183,7 +183,9 @@ async def get_sql_agent(cls) -> dict: - Do not use client name for filtering - Assets table contains snapshots by date; do not sum values across dates - Use StartTime for time-based filtering (meetings) - - For asset values: if question is about total "asset value"/"portfolio value"/"AUM" → return SUM of latest investments; if about "current asset/investment value" → return all latest investments without SUM. + - For asset values: + - If the question is about total "asset value", "what is the asset value", "portfolio value", or "AUM" → ALWAYS return the SUM of the latest investments (do not return individual rows). + - If the question is about "current asset value" or "current investment value" → return all latest investments without SUM. - Only return the raw T-SQL query. No explanations or comments. """