@extends('layouts.app') @section('title', 'Assistant conversations') @section('page', 'conversations') @section('content') @php $flag = fn ($c) => match (true) { $c->rating === 'not_helpful' || $c->messages->contains('rating', 'not_helpful') => ['bad', badge('Rated not helpful', 'b-red')], $c->status === 'handed_over' => ['handoff', badge('Handed to team', 'b-blue')], $c->status === 'missed' => ['missed', badge('No answer', 'b-amber')], default => ['answered', badge('Answered', 'b-green')], }; $first = $convs->first(); @endphp

Assistant conversations

Read what clients asked {{ agency()->assistant?->name ?? 'Desk Assistant' }}. Fix weak answers and they're used from the next question on.

Knowledge HubExport
Conversations this month
{{ $stats['total'] }}
@if ($stats['change'] !== null)
{{ abs($stats['change']) }}% {{ $stats['change'] >= 0 ? 'more' : 'fewer' }} than {{ $stats['lastMonth'] }}
@else
First month of data
@endif
Answered by the assistant
{{ $stats['answeredPct'] }}%
{{ $stats['answered'] }} of {{ $stats['total'] }}
Handed to your team
{{ $stats['handedPct'] }}%
{{ plural($stats['handed'], 'conversation') }}
Rated helpful
{{ $stats['helpfulPct'] !== null ? $stats['helpfulPct'].'%' : 'No ratings' }}
{{ $stats['bad'] ? $stats['bad'].' rated not helpful' : 'None rated not helpful' }}
@if ($convs->isEmpty())
No conversations yetWhen clients ask {{ agency()->assistant?->name ?? 'Desk Assistant' }} something, the conversation shows up here.
@else
{{ av($first->user) }}
{{ $first->user?->name ?? 'Visitor' }}{{ $first->client?->company_name }}
@if ($first->client)Client profile@endif
@foreach ($convs as $c)
@php $lastQ = null; @endphp @foreach ($c->messages as $m) @if ($m->role === 'user') @php $lastQ = $m->body; @endphp
{{ $m->body }}
@else
{!! nl2br(e($m->body)) !!}@if ($m->source_label){{ $m->source_label }}@endif
@if ($m->rating === 'helpful')Client rated helpful@elseif ($m->rating === 'not_helpful')Client rated not helpful@endif @if ($canTrain && $lastQ)@endif
@endif @endforeach
@endforeach
@endif @if ($canTrain) @endif @endsection @if ($canTrain) @push('scripts') @endpush @endif