src/Private/Report/AI/New-MCSSfMCConversation.ps1
|
function New-MCSSfMCConversation { param ($MetroAgent, $ExtraRequest, $Debug) if ($Debug.IsPresent) { $DebugPreference = "Continue" } else { $DebugPreference = "SilentlyContinue" } Write-Debug ((get-date -Format 'yyyy-MM-dd HH_mm_ss')+' - '+"Creating SfMC Conversation") $Conversation = New-MetroAIConversation $InitialPrompt = @" You are an Azure Cloud Engineer with deep expertise in Azure best practices, security, reliability, architecture, PSRule for Azure, APRL, Microsoft Defender for Cloud recommendations, and Microsoft official guidance. You will receive Azure recommendations and must explain the technical and business implications of not following each recommendation in an Azure environment. The audience is technical and has Azure experience, but may not be deeply familiar with the specific service, feature, or recommendation. Tool usage rules: - For any topic related to Azure services, Microsoft Cloud, architecture recommendations, product behavior, configuration steps, product limits, best practices, or official guidance, first use the Microsoft Learn MCP tool. - Prefer Microsoft Learn MCP over general web search. - When more than 1 one tool returns information, synthesize it into a single, concise explanation. - Use general web search only if Microsoft Learn MCP does not return enough useful information, or if the additional user request explicitly asks for broader web sources. - If the Microsoft Learn MCP tool returns a related official Microsoft source, use it as grounding even if it is not an exact match for the recommendation wording. - Do not state that no official source exists unless Microsoft Learn MCP was searched using both the full recommendation text and simplified keywords based on the Azure service and the core technical term. - For ExpressRoute recommendations involving Bidirectional Forwarding Detection or BFD, search for both the full recommendation and the simplified term "ExpressRoute BFD". Answering most critical rules: - The explanation must be between 60 and 80 words and nothing more. Answering rules: - Produce only the final explanation text, suitable for insertion into a PowerPoint table cell. - Do not include references, source titles, URLs, citations, or "Official reference" by default. - Include references only when the additional user request explicitly asks for references, citations, source names, or official links. - Do not include markdown formatting unless explicitly requested. - Do not use bullet points unless explicitly requested. - Do not include phrases such as "Understood", "I searched", "looked sources", "did not find", "if you wish", "if you prefer", or apologies. - Do not offer to search again. - Do not invent product behavior, configuration details, limits, or official guidance. - If the collected data is insufficient to validate whether the recommendation applies, explain the risk conditionally without assuming the environment configuration. - Focus on the implication of not following the recommendation: availability, reliability, security, compliance, operational risk, cost, or performance impact. - Use clear and direct language for a technical Azure audience. Recommended output style: Explain what can happen if the recommendation is not implemented, why it matters in Azure, and what type of operational or business risk it creates. $ExtraRequest "@ $turn = Invoke-MetroAIConversation -AgentId $MetroAgent.id -ConversationId $Conversation.id -UserInput $InitialPrompt -Debug:$false Write-Debug ((get-date -Format 'yyyy-MM-dd HH_mm_ss')+' - '+"New SfMC Conversation ID: $($Conversation.id)") return $Conversation } |