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:
25
resources/views/components/admin/confidence-badge.blade.php
Normal file
25
resources/views/components/admin/confidence-badge.blade.php
Normal file
@@ -0,0 +1,25 @@
|
||||
@props([
|
||||
'confidence',
|
||||
'threshold' => \App\Services\KnowledgeGapService::CONFIDENCE_THRESHOLD,
|
||||
])
|
||||
|
||||
@php
|
||||
$score = (float) $confidence;
|
||||
$passes = $score >= (float) $threshold;
|
||||
@endphp
|
||||
|
||||
<span @class([
|
||||
'inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium',
|
||||
'bg-green-100 text-green-800' => $passes,
|
||||
'bg-amber-100 text-amber-900' => ! $passes,
|
||||
])>
|
||||
<span @class([
|
||||
'h-2 w-2 rounded-full',
|
||||
'bg-green-600' => $passes,
|
||||
'bg-amber-600' => ! $passes,
|
||||
])></span>
|
||||
Confidence {{ number_format($score, 2) }}
|
||||
<span class="text-[11px] opacity-80">
|
||||
{{ $passes ? 'haalt drempel' : 'onder drempel' }} {{ number_format((float) $threshold, 2) }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -17,6 +17,7 @@
|
||||
<nav class="flex gap-3 text-sm">
|
||||
<a href="{{ route('admin.dashboard') }}" class="hover:underline">Dashboard</a>
|
||||
<a href="{{ route('admin.articles') }}" class="hover:underline">Articles</a>
|
||||
<a href="{{ route('admin.knowledge-search-demo') }}" class="hover:underline">KB demo</a>
|
||||
<a href="{{ route('admin.quick-replies') }}" class="hover:underline">Snelantwoorden</a>
|
||||
<a href="{{ route('admin.tickets') }}" class="hover:underline">Tickets</a>
|
||||
<a href="{{ route('admin.process') }}" class="hover:underline">Proces</a>
|
||||
|
||||
Reference in New Issue
Block a user