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

function Get-MCSSfMCDetails {
    Param(
        $FoundryEndpoint,
        $MetroAgent,
        $ExtraRequest,
        $Debug
    )

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

    Write-Debug ((get-date -Format 'yyyy-MM-dd HH_mm_ss')+' - '+"Getting SfMC Details by AI")

    $Conversation = New-MetroAIConversation

    $Prompt = @"
In less than 25 words, explain what is the 'Support for Mission Critical' team at Microsoft.
 
Answering rules:
- Produce only the final explanation text, suitable for insertion into a PowerPoint table cell.
- The explanation should be focus on executive level and should be very polite.
- The explanation must be between 20 and 25 words.
- The explanation must absolutely not look it was written by AI and should not contain anything besides the requested answer.
- The text should explain how the Support for Mission Critical team focus on the Microsoft customers.
- Do not include references, source titles, URLs, citations, or "Official reference" by default.
- Make sure to mention the 'Mission Critical' name.
- Do not include markdown formatting.
- Do not use bullet points.
- 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.
- Make sure to not look like it was written by AI and make sure to only answer with the 15 words and nothing more.
 
$ExtraRequest
"@


    try
        {
            $turn  = Invoke-MetroAIConversation -AgentId $MetroAgent.id -ConversationId $Conversation.id -UserInput $Prompt -Debug:$false
            Write-Debug ((get-date -Format 'yyyy-MM-dd HH_mm_ss')+' - '+"AI Response ID: $($turn.ResponseId)")
            Start-Sleep -Milliseconds 500
        }
    catch
        {
            Write-Warning "Error invoking AI conversation for SfMC details. Error: $_"
            $turn = @{ AssistantText = "Mission Critical provides a designated team of experts working through a well-honed process, committed to delivering top levels of health and performance for the solutions that matter most." }
        }

    return $turn.AssistantText

}