Skip to content

Instantly share code, notes, and snippets.

$TenantID = "xxxxxx"
$LogicAppSeObjectID = "xxxxxxx"
$ServicePrincipalId = $LogicAppSeObjectID
$GraphResource = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'"
$application_role_to_assign_name = "Chat.Read.All"
$Permission = $GraphResource.AppRoles | Where-Object {$_.value -in $application_role_to_assign_name}
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $ServicePrincipalId -PrincipalId $ServicePrincipalId -AppRoleId $Permission.Id -ResourceId $GraphResource.Id
{
"properties": {
"choices": {
"items": {
"properties": {
"content_filter_results": {
"properties": {
"hate": {
"properties": {
"filtered": {
{
"items": {
"properties": {
"content": {
"type": "string"
},
"role": {
"type": "string"
}
},
[
{
@{outputs('Compose_ConversationHistoryReversed_2')}
},
{
"role": "system", "content": "You are a helpful assistant. Format all your replies in HTML code, but dont mention HTML in the response."
}
]
substring(variables('ConversationHistoryReversed'), 1, sub(length(variables('ConversationHistoryReversed')),2))
substring(variables('ConversationHistoryReversed'), 1, sub(length(variables('ConversationHistoryReversed')),2))
replace(variables('ConversationHistoryReversed'), '<p>', '')
replace(variables('ConversationHistoryReversed'), '</p>', '')
reverse(variables('ArrayMessages'))