feat: Enhance Support Reply Service with tone instructions and article details
- Added tone instruction retrieval to SupportReplyService. - Improved user feedback when no relevant article is found. - Included article URL and tone instruction in LLM prompt. - Updated response format to include source information. - Enhanced article management UI with search functionality and editing capabilities. - Introduced a new API endpoint for nearest articles based on vector search. - Added confidence badge component to display article confidence levels. - Implemented tests for article searching, editing, and nearest article API. - Removed obsolete .htaccess file.
This commit is contained in:
@@ -8,6 +8,8 @@ use Illuminate\Support\Str;
|
||||
|
||||
class KnowledgeGapService
|
||||
{
|
||||
public const CONFIDENCE_THRESHOLD = 0.45;
|
||||
|
||||
public function __construct(
|
||||
private readonly LlmClientInterface $llmClient,
|
||||
private readonly AppSettingsService $settings,
|
||||
@@ -16,7 +18,7 @@ class KnowledgeGapService
|
||||
public function shouldCreateDraft(Ticket $ticket, array $result): bool
|
||||
{
|
||||
$confidence = (float) ($result['confidence'] ?? 0);
|
||||
if ($confidence < 0.45) {
|
||||
if ($confidence < self::CONFIDENCE_THRESHOLD) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,6 +43,7 @@ class KnowledgeGapService
|
||||
$prompt = $basePrompt."\n\n".
|
||||
"Klantvraag:\n{$question}\n\n".
|
||||
"Originele taal: {$language}. Schrijf titel en inhoud in deze taal.\n\n".
|
||||
'Aanspreekvorm: '.$this->settings->toneInstruction()."\n\n".
|
||||
"Huidige kandidaten (mogelijk onvoldoende):\n{$topCandidates}\n\n".
|
||||
'Content moet praktisch zijn met duidelijke stappen.';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user