mirror of
https://gh.wpcy.net/https://github.com/thomas-deep/freescoutAI.git
synced 2026-07-15 08:48:40 +08:00
- Added MistralProvider, OllamaProvider, OpenAIProvider, and OpenRouterProvider classes for AI functionalities. - Created DefaultPrompts service for managing standard prompts for email prioritization, response suggestions, text modifications, and summarization. - Developed a user interface for customizing prompts within FreeScout settings. - Established a comprehensive test plan covering installation, configuration, email prioritization, response suggestions, text modifications, and performance. - Included module metadata in module.json and routing setup in start.php.
56 lines
2 KiB
PHP
56 lines
2 KiB
PHP
<?php
|
|
|
|
namespace Modules\FreeScoutAI\Services;
|
|
|
|
interface AIProviderInterface
|
|
{
|
|
/**
|
|
* Initialize the provider with settings
|
|
*
|
|
* @param string $api_key API key for the provider
|
|
* @param string $model Model to use
|
|
* @param array $additional_settings Any additional settings needed
|
|
* @return void
|
|
*/
|
|
public function initialize($api_key, $model, $additional_settings = []);
|
|
|
|
/**
|
|
* Prioritize an email
|
|
*
|
|
* @param string $email_content The content of the email
|
|
* @param array $customer_info Optional customer information
|
|
* @param string $prompt Custom prompt to use (if null, use default)
|
|
* @return array ['priority' => 'A|B|C', 'reason' => 'Reason for prioritization']
|
|
*/
|
|
public function prioritize($email_content, $customer_info = [], $prompt = null);
|
|
|
|
/**
|
|
* Generate a response suggestion
|
|
*
|
|
* @param string $email_content The content of the email to respond to
|
|
* @param array $conversation_history Optional conversation history
|
|
* @param array $customer_info Optional customer information
|
|
* @param string $prompt Custom prompt to use (if null, use default)
|
|
* @return string The suggested response
|
|
*/
|
|
public function suggest($email_content, $conversation_history = [], $customer_info = [], $prompt = null);
|
|
|
|
/**
|
|
* Modify text according to the specified mode
|
|
*
|
|
* @param string $text The text to modify
|
|
* @param string $mode The modification mode (shorten, expand, formal, personal)
|
|
* @param string $prompt Custom prompt to use (if null, use default)
|
|
* @return string The modified text
|
|
*/
|
|
public function modify($text, $mode, $prompt = null);
|
|
|
|
/**
|
|
* Summarize a conversation
|
|
*
|
|
* @param array $conversation_history The conversation history to summarize
|
|
* @param string $prompt Custom prompt to use (if null, use default)
|
|
* @return string The summary
|
|
*/
|
|
public function summarize($conversation_history, $prompt = null);
|
|
}
|