src/Private/Report/AI/Get-MCSMetroAIRiskImplications.ps1

function Get-MCSMetroAIRiskImplications {
    Param(
        $RecommendationTitle,
        $RecommendationDescription,
        $ExtraRequest,
        $MetroAgent,
        $Conversation,
        $Debug
    )

    if ($Debug.IsPresent) {
        $DebugPreference = "Continue"
    } else {
        $DebugPreference = "SilentlyContinue"
    }

    Write-Debug ((get-date -Format 'yyyy-MM-dd HH_mm_ss')+' - '+"Getting AI Risk implications for: $RecommendationTitle")

    $Prompt = "Considering an Azure Environment and the following recommendation: $RecommendationTitle (with the following deeper explanation: $RecommendationDescription). In less than 50 words, explain to me what are the risks involved in not following that recommendation (make sure to not appear the answer was given by AI). $ExtraRequest"

    $turn  = Invoke-MetroAIConversation -AgentId $MetroAgent.id -ConversationId $Conversation.id -UserInput $Prompt -Debug:$false

    Start-Sleep -Seconds 5

    Write-Debug ((get-date -Format 'yyyy-MM-dd HH_mm_ss')+' - '+"AI Response ID: $($turn.ResponseId)")

    return  $turn.AssistantText
}