Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
dev: Option to disable content filter
Clémence Lesné3d3718e09cdc
diff --git a/Makefile b/Makefileindex 5dfd14e..802d80b 100644--- a/Makefile+++ b/Makefile@@ -16,6 +16,8 @@ name_sanitized := $(shell echo $(name) | tr '[:upper:]' '[:lower:]')bot_phone_number ?= $(shell cat config.yaml | yq '.communication_services.phone_number')event_subscription_name ?= $(shell echo '$(name_sanitized)-$(bot_phone_number)' | tr -dc '[:alnum:]-')twilio_phone_number ?= $(shell cat config.yaml | yq '.sms.twilio.phone_number')+# Bicep inputs+prompt_content_filter ?= true# Bicep outputsapp_url ?= $(shell az deployment sub show --name $(name_sanitized) | yq '.properties.outputs["appUrl"].value')blob_storage_public_name ?= $(shell az deployment sub show --name $(name_sanitized) | yq '.properties.outputs["blobStoragePublicName"].value')@@ -139,6 +141,7 @@ deploy-bicep:'functionappLocation=$(functionapp_location)' \'instance=$(name)' \'openaiLocation=$(openai_location)' \+ 'promptContentFilter=$(prompt_content_filter)' \'searchLocation=$(search_location)' \'version=$(version_full)' \--template-file bicep/main.bicep \diff --git a/bicep/app.bicep b/bicep/app.bicepindex 7a39238..65c9ceb 100644--- a/bicep/app.bicep+++ b/bicep/app.bicep@@ -16,6 +16,7 @@ param llmSlowQuota intparam llmSlowVersion stringparam location stringparam openaiLocation string+param promptContentFilter boolparam searchLocation stringparam tags objectparam version string@@ -473,6 +474,7 @@ resource contentfilter 'Microsoft.CognitiveServices/accounts/raiPolicies@2024-04contentFilters: [// Indirect attacks{+ allowedContentLevel: 'Medium'blocking: trueenabled: truename: 'indirect_attack'@@ -480,6 +482,7 @@ resource contentfilter 'Microsoft.CognitiveServices/accounts/raiPolicies@2024-04}// Jailbreak{+ allowedContentLevel: 'Medium'blocking: trueenabled: truename: 'jailbreak'@@ -487,63 +490,73 @@ resource contentfilter 'Microsoft.CognitiveServices/accounts/raiPolicies@2024-04}// Prompt{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'hate'source: 'Prompt'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'sexual'source: 'Prompt'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'selfharm'source: 'Prompt'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'violence'source: 'Prompt'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'profanity'source: 'Prompt'}// Completion{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'hate'source: 'Completion'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'sexual'source: 'Completion'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'selfharm'source: 'Completion'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'violence'source: 'Completion'}{- blocking: false- enabled: false+ allowedContentLevel: 'Low'+ blocking: !promptContentFilter+ enabled: !promptContentFiltername: 'profanity'source: 'Completion'}diff --git a/bicep/main.bicep b/bicep/main.bicepindex fdef80a..2162b04 100644--- a/bicep/main.bicep+++ b/bicep/main.bicep@@ -1,5 +1,5 @@param cognitiveCommunicationLocation string-param embeddingDeploymentType string = 'Standard' // Pay-as-you-go in a single region+param embeddingDeploymentType string = 'Standard' // Pay-as-you-go in a single regionparam embeddingModel string = 'text-embedding-ada-002'param embeddingQuota int = 100param embeddingVersion string = '2'@@ -17,6 +17,7 @@ param llmSlowQuota int = 400param llmSlowVersion string = '2024-05-13'param location string = deployment().locationparam openaiLocation string+param promptContentFilter bool = true // Should be set to false but requires a custom approval from Microsoftparam searchLocation stringparam version string@@ -64,6 +65,7 @@ module app 'app.bicep' = {llmSlowVersion: llmSlowVersionlocation: locationopenaiLocation: openaiLocation+ promptContentFilter: promptContentFiltersearchLocation: searchLocationtags: tagsversion: version