Add settings: summary_model_prompt, summary_model_name

- Use these new settings to allow a custom AI prompt and language model.
This commit is contained in:
FusionPBX
2026-01-28 12:39:18 -07:00
committed by GitHub
parent 3f356ac58f
commit 30a60c655d
2 changed files with 26 additions and 4 deletions

View File

@@ -85,3 +85,19 @@
$apps[$x]['default_settings'][$y]['default_setting_value'] = "transcription";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Call recordings used to select the email template.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "7c188b97-7a51-4358-844b-124dc960a4c5";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_recordings";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "summary_model_prompt";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "Summarize this conversation with Key Points, Action Items if any, and Sentiment. Use names when they are provided. Return text without markdown.";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "The language model prompt to generate the call summary.";
$y++;
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "bf1c4aec-ef13-4a6d-aa00-204ab0dbb751";
$apps[$x]['default_settings'][$y]['default_setting_category'] = "call_recordings";
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "summary_model_name";
$apps[$x]['default_settings'][$y]['default_setting_name'] = "text";
$apps[$x]['default_settings'][$y]['default_setting_value'] = "ministral-3:8b";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "The language model name used to generate the call summary.";

View File

@@ -222,13 +222,19 @@ class call_recordings {
//get the transcribed text
$transcribe_text = transcribe::conversation_format($params['transcribe_message'], 'text');
//prepare the prompt
$prompt = "Summarize this conversation with Key Points, Action Items if any, and Sentiment. Don't include swearing in the summary. Return text without markdown.";
//get the summary language model prompt
$default_prompt = "Summarize this conversation with Key Points, Action Items if any, and Sentiment. Use names when they are provided. Keep the summary professional. Return text without markdown.";
$prompt = $this->settings->get('call_recordings', 'summary_model_prompt', $default_prompt);
//combine the prompt with the call transcript
$request_data['prompt'] = $prompt . "```\n".$transcribe_text."\n```";
//load the language model and get the
//get the summary language model name
$request_model = $this->settings->get('call_recordings', 'summary_model_name', 'ministral-3:8b');
//load the language model and get the call summary
$language_model = new language_model();
$params['transcript_summary'] = $language_model->request('ministral-3:8b', $request_data);
$params['transcript_summary'] = $language_model->request($request_model, $request_data);
}
//prepare the array with the transcript details