@extends('layouts.admin') @section('title', 'Butiran Log Chat') @section('breadcrumb') @endsection @section('content')
{{-- Soalan & Jawapan --}}
Perbualan
@if($chatLog->category) {{ $chatLog->category->name }} @endif @if(!$chatLog->has_answer) Tidak Terjawab @endif
{{ $chatLog->question }}
{{ $chatLog->answer }}
{{-- Sumber --}} @if($chatLog->sources_used)
Sumber Digunakan ({{ count($chatLog->sources_used) }})
@foreach($chatLog->sources_used as $i => $source)
{{ strtoupper($source['type'] ?? 'unknown') }} {{ $source['title'] }} @if(isset($source['page_number'])) ms. {{ $source['page_number'] }} @endif {{ $source['category'] }} Skor: {{ $source['score'] }}
@endforeach
@endif {{-- Feedback --}} @if($chatLog->feedback)
Feedback Pengguna
@php $ratingLabels = ['helpful' => 'Membantu', 'not_helpful' => 'Tidak Membantu', 'partially_helpful' => 'Separa Membantu']; @endphp

Rating: {{ $ratingLabels[$chatLog->feedback->rating] ?? $chatLog->feedback->rating }}

@if($chatLog->feedback->comment)

Komen: {{ $chatLog->feedback->comment }}

@endif @if($chatLog->feedback->correct_answer)
Jawapan Betul (dari user):
{{ $chatLog->feedback->correct_answer }}
@endif
@endif {{-- Convert ke FAQ --}} @if(!($chatLog->feedback && $chatLog->feedback->converted_to_faq))
Convert kepada FAQ Rasmi

Gunakan soalan ini sebagai asas FAQ baru yang akan dimasukkan ke dalam knowledge base.

@csrf
@else
Log ini telah dijadikan FAQ. Lihat FAQ
@endif
{{-- Meta Info --}}
Maklumat
Model AI
{{ $chatLog->model_used ?? '—' }}
Masa Respons
{{ $chatLog->response_time ? $chatLog->response_time . 's' : '—' }}
Token
{{ $chatLog->tokens_used ? number_format($chatLog->tokens_used) : '—' }}
Tarikh
{{ $chatLog->created_at->format('d/m/Y H:i') }}
Flag
@csrf @method('PATCH')
@endsection