Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

refacto: Lower code complexity in Makefile

Clémence Lesnéac91714a2d58
diff --git a/Makefile b/Makefile
index 62bb9bc..9ec3b74 100644
--- a/Makefile
+++ b/Makefile
@@ -133,7 +133,6 @@ deploy:
'agentPhoneNumber=$(agent_phone_number)' \
'botCompany=$(bot_company)' \
'botName=$(bot_name)' \
- 'botPhoneNumber=$(bot_phone_number)' \
'openaiLocation=$(openai_location)' \
'searchLocation=$(search_location)' \
--template-file bicep/main.bicep \
diff --git a/bicep/app.bicep b/bicep/app.bicep
index 392bef2..03921d7 100644
--- a/bicep/app.bicep
+++ b/bicep/app.bicep
@@ -3,7 +3,6 @@ param adaVersion string
param agentPhoneNumber string
param botCompany string
param botName string
-param botPhoneNumber string
param gptBackupContext int
param gptBackupModel string
param gptBackupVersion string
@@ -22,6 +21,7 @@ var appUrl = 'https://claim-ai.${acaEnv.properties.defaultDomain}'
var gptBackupModelFullName = toLower('${gptBackupModel}-${gptBackupVersion}')
var gptModelFullName = toLower('${gptModel}-${gptVersion}')
var adaModelFullName = toLower('${adaModel}-${adaVersion}')
+var localConfig = loadYamlContent('../config.yaml')
var config = {
api: {
events_domain: appUrl
@@ -47,14 +47,14 @@ var config = {
agent_phone_number: agentPhoneNumber
bot_company: botCompany
bot_name: botName
- lang: loadYamlContent('../config.yaml').workflow.lang
+ lang: localConfig.workflow.lang
}
communication_service: {
access_key: communication.listKeys().primaryKey
endpoint: communication.properties.hostName
- phone_number: botPhoneNumber
+ phone_number: localConfig.communication_service.phone_number
}
- sms: loadYamlContent('../config.yaml').sms
+ sms: localConfig.sms
cognitive_service: {
endpoint: cognitiveCommunication.properties.endpoint
}
@@ -92,8 +92,8 @@ var config = {
endpoint: cognitiveContentsafety.properties.endpoint
}
prompts: {
- llm: loadYamlContent('../config.yaml').prompts.llm
- tts: loadYamlContent('../config.yaml').prompts.tts
+ llm: localConfig.prompts.llm
+ tts: localConfig.prompts.tts
}
ai_translation: {
access_key: translate.listKeys().key1
diff --git a/bicep/main.bicep b/bicep/main.bicep
index 8a471f0..124f63e 100644
--- a/bicep/main.bicep
+++ b/bicep/main.bicep
@@ -3,7 +3,6 @@ param adaVersion string = '2'
param agentPhoneNumber string
param botCompany string
param botName string
-param botPhoneNumber string
param gptBackupContext int = 16385
param gptBackupModel string = 'gpt-35-turbo'
param gptBackupVersion string = '0125'
@@ -46,7 +45,6 @@ module app 'app.bicep' = {
agentPhoneNumber: agentPhoneNumber
botCompany: botCompany
botName: botName
- botPhoneNumber: botPhoneNumber
gptBackupContext: gptBackupContext
gptBackupModel: gptBackupModel
gptBackupVersion: gptBackupVersion