From 67d9d2358609534bc42e867b68222d71312d5e52 Mon Sep 17 00:00:00 2001 From: Alfred Nutile Date: Wed, 29 May 2024 12:06:13 -0400 Subject: [PATCH] move to the documents component --- app/Domains/EmailParser/EmailClient.php | 8 ++++++++ app/Jobs/SummarizeDocumentJob.php | 2 -- .../Pages/Collection/Components/Documents.vue | 19 ++++++++++++++++++- resources/js/Pages/Collection/Show.vue | 14 +------------- tests/Feature/EmailClientTest.php | 1 - 5 files changed, 27 insertions(+), 17 deletions(-) diff --git a/app/Domains/EmailParser/EmailClient.php b/app/Domains/EmailParser/EmailClient.php index c9a79a8f..9952b491 100644 --- a/app/Domains/EmailParser/EmailClient.php +++ b/app/Domains/EmailParser/EmailClient.php @@ -46,6 +46,10 @@ public function handle(Source $source): array $foldersToCheck = explode(',', trim($source->secrets['email_box'])); + $foldersToCheck = collect($foldersToCheck)->map(function ($folder) { + return str($folder)->lower()->toString(); + })->toArray(); + $secrets = $source->secrets; $config = [ @@ -83,10 +87,14 @@ public function handle(Source $source): array foreach ($folders as $folder) { $full_name = data_get($folder, 'full_name'); + Log::info('Checking folder', [ 'full_name' => $full_name, 'folders_to_check' => $foldersToCheck, ]); + + $full_name = str($full_name)->lower()->toString(); + if (in_array($full_name, $foldersToCheck)) { $messages = $folder->messages()->all()->get(); logger('[LaraChain] - Email Box Count', [ diff --git a/app/Jobs/SummarizeDocumentJob.php b/app/Jobs/SummarizeDocumentJob.php index 168b1e21..6cb615a8 100644 --- a/app/Jobs/SummarizeDocumentJob.php +++ b/app/Jobs/SummarizeDocumentJob.php @@ -77,8 +77,6 @@ public function handle(): void ], $this->prompt); } - put_fixture('prompt_being_used_summary.txt', $prompt, false); - /** @var CompletionResponse $results */ $results = LlmDriverFacade::driver( $this->document->getDriver() diff --git a/resources/js/Pages/Collection/Components/Documents.vue b/resources/js/Pages/Collection/Components/Documents.vue index c912ba2b..f5de1fb6 100644 --- a/resources/js/Pages/Collection/Components/Documents.vue +++ b/resources/js/Pages/Collection/Components/Documents.vue @@ -1,5 +1,5 @@