Skip to content

Conversation

@VishalS-Microsoft
Copy link
Contributor

Purpose

This pull request introduces updates to improve functionality, enhance clarity, and ensure compatibility across the codebase. The most significant changes include adjustments to SQL query prompts for better handling of scheduling-related queries, updates to Azure CLI version requirements, and modifications to parameter documentation for consistency.

Enhancements to SQL Query Prompts:

  • Updated the SQL query prompt in infra/main.bicep, infra/main.json, and src/App/backend/plugins/chat_with_data_plugin.py to include logic for handling scheduling or time-based meeting queries. The queries now use the StartTime column from the ClientMeetings table to determine the most recent past or nearest future meeting. This ensures accurate timing comparisons. [1] [2] [3]

Compatibility Updates:

  • Added a requiredVersions field in azure.yaml to specify that azd version 1.15.0 or higher is required.
  • Updated the DeploymentGuide.md to reflect the new Azure Developer CLI (azd) version requirement of 1.15.0+.

Documentation Improvements:

  • Modified CustomizingAzdParameters.md to replace RESOURCE_GROUP_NAME_FOUNDRY with AZURE_EXISTING_AI_PROJECT_RESOURCE_ID for better clarity and alignment with naming conventions.
  • Removed references to specific Azure OpenAI regions (swedencentral, australiaeast) from DeploymentGuide.md to allow for broader region selection.

Infrastructure Updates:

  • Updated the templateHash value in infra/main.json to reflect changes in the infrastructure template.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds scheduling logic to SQL prompts, updates version requirements for the Azure Developer CLI, renames a parameter for clarity, removes specific region references, and bumps the infrastructure template hash.

  • Enhanced SQL prompts in multiple files to handle scheduling/time-based meeting queries.
  • Added requiredVersions for azd (>= 1.15.0) and updated related documentation.
  • Renamed RESOURCE_GROUP_NAME_FOUNDRY to AZURE_EXISTING_AI_PROJECT_RESOURCE_ID for consistency.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/App/backend/plugins/chat_with_data_plugin.py Added scheduling logic guidance to the SQL query prompt.
infra/main.json Updated templateHash and extended SQL prompt to include scheduling conditions.
infra/main.bicep Extended the functionAppSqlPrompt variable to include scheduling logic.
docs/DeploymentGuide.md Updated Azure Developer CLI version requirement and removed specific region entry.
docs/CustomizingAzdParameters.md Replaced RESOURCE_GROUP_NAME_FOUNDRY with AZURE_EXISTING_AI_PROJECT_RESOURCE_ID.
azure.yaml Added requiredVersions constraint specifying azd: ">= 1.15.0".
Comments suppressed due to low confidence (1)

docs/DeploymentGuide.md:80

  • [nitpick] The suffix '- version' is redundant and may confuse readers. Consider removing it for clarity.
    - [Azure Developer CLI (azd)](https://aka.ms/install-azd) <small>(v1.15.0+)</small> - version

ALWAYS use ClientId = {clientid} in the query filter.
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.
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This prompt logic is duplicated in multiple files (JSON, Bicep, and Python). Consider centralizing it in a shared constant or configuration to reduce duplication and ease future updates.

Copilot uses AI. Check for mistakes.
"solutionPrefix": "[format('ca{0}', padLeft(take(variables('uniqueId'), 12), 12, '0'))]",
"abbrs": "[variables('$fxv#0')]",
"functionAppSqlPrompt": "Generate a valid T-SQL query to find {query} for tables and columns provided below:\n 1. Table: Clients\n Columns: ClientId, Client, Email, Occupation, MaritalStatus, Dependents\n 2. Table: InvestmentGoals\n Columns: ClientId, InvestmentGoal\n 3. Table: Assets\n Columns: ClientId, AssetDate, Investment, ROI, Revenue, AssetType\n 4. Table: ClientSummaries\n Columns: ClientId, ClientSummary\n 5. Table: InvestmentGoalsDetails\n Columns: ClientId, InvestmentGoal, TargetAmount, Contribution\n 6. Table: Retirement\n Columns: ClientId, StatusDate, RetirementGoalProgress, EducationGoalProgress\n 7. Table: ClientMeetings\n Columns: ClientId, ConversationId, Title, StartTime, EndTime, Advisor, ClientEmail\n Always use the Investment column from the Assets table as the value.\n Assets table has snapshots of values by date. Do not add numbers across different dates for total values.\n Do not use client name in filters.\n Do not include assets values unless asked for.\n ALWAYS use ClientId = {clientid} in the query filter.\n ALWAYS select Client Name (Column: Client) in the query.\n Query filters are IMPORTANT. Add filters like AssetType, AssetDate, etc. if needed.\n Only return the generated SQL query. Do not return anything else.",
"functionAppSqlPrompt": "Generate a valid T-SQL query to find {query} for tables and columns provided below:\n 1. Table: Clients\n Columns: ClientId, Client, Email, Occupation, MaritalStatus, Dependents\n 2. Table: InvestmentGoals\n Columns: ClientId, InvestmentGoal\n 3. Table: Assets\n Columns: ClientId, AssetDate, Investment, ROI, Revenue, AssetType\n 4. Table: ClientSummaries\n Columns: ClientId, ClientSummary\n 5. Table: InvestmentGoalsDetails\n Columns: ClientId, InvestmentGoal, TargetAmount, Contribution\n 6. Table: Retirement\n Columns: ClientId, StatusDate, RetirementGoalProgress, EducationGoalProgress\n 7. Table: ClientMeetings\n Columns: ClientId, ConversationId, Title, StartTime, EndTime, Advisor, ClientEmail\n Always use the Investment column from the Assets table as the value.\n Assets table has snapshots of values by date. Do not add numbers across different dates for total values.\n Do not use client name in filters.\n Do not include assets values unless asked for.\n ALWAYS use ClientId = {clientid} in the query filter.\n ALWAYS select Client Name (Column: Client) in the query.\n Query filters are IMPORTANT. Add filters like AssetType, AssetDate, etc. if needed.\n 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.\n Only return the generated SQL query. Do not return anything else.",
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This prompt logic is duplicated in multiple files (Python, Bicep, and JSON). Consider extracting it into a single source to improve consistency and maintainability.

Copilot uses AI. Check for mistakes.
ALWAYS use ClientId = {clientid} in the query filter.
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.
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Prompt guidance is repeated across Python, JSON, and Bicep files. Extracting this into a shared template or variable could help maintain consistency.

Copilot uses AI. Check for mistakes.
@Roopan-Microsoft Roopan-Microsoft merged commit 22125fc into main Jul 11, 2025
12 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Priyanka-Microsoft Priyanka-Microsoft deleted the dev branch July 14, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants