diff --git a/Modules/LlmDriver/app/Functions/SearchAndSummarize.php b/Modules/LlmDriver/app/Functions/SearchAndSummarize.php index 8152dfd3..3f0c6f19 100644 --- a/Modules/LlmDriver/app/Functions/SearchAndSummarize.php +++ b/Modules/LlmDriver/app/Functions/SearchAndSummarize.php @@ -7,7 +7,6 @@ use App\Domains\Messages\RoleEnum; use App\Domains\Prompts\SummarizePrompt; use App\Models\Chat; -use App\Models\Message; use App\Models\PromptHistory; use Facades\App\Domains\Agents\VerifyResponseAgent; use Facades\LlmLaraHub\LlmDriver\DistanceQuery; @@ -110,8 +109,7 @@ public function handle( notify_ui($model, 'Building Summary'); - - if(!get_class($model) === Chat::class) { + if (! get_class($model) === Chat::class) { Log::info('[LaraChain] Using the Simple Completion', [ 'input' => $contentFlattened, 'driver' => $model->getChatable()->getDriver(), diff --git a/app/Domains/Messages/SearchAndSummarizeChatRepo.php b/app/Domains/Messages/SearchAndSummarizeChatRepo.php index 1f98a3ab..426ffed1 100644 --- a/app/Domains/Messages/SearchAndSummarizeChatRepo.php +++ b/app/Domains/Messages/SearchAndSummarizeChatRepo.php @@ -29,8 +29,8 @@ public function search(Chat $chat, ?Filter $filter = null): string { Log::info('[LaraChain] Search and Summarize Default Function', [ - 'note' => "Showing input since some system grab the last on the array", - 'input' => $input + 'note' => 'Showing input since some system grab the last on the array', + 'input' => $input, ]); $originalPrompt = $input; diff --git a/tests/Feature/SearchAndSummarizeChatRepoTest.php b/tests/Feature/SearchAndSummarizeChatRepoTest.php index dcd0baaf..89a46be5 100644 --- a/tests/Feature/SearchAndSummarizeChatRepoTest.php +++ b/tests/Feature/SearchAndSummarizeChatRepoTest.php @@ -24,7 +24,7 @@ public function test_can_search(): void $data = 'Foo bar'; $dto = new \LlmLaraHub\LlmDriver\Responses\CompletionResponse($data); - LlmDriverFacade::shouldReceive('driver->completion') + LlmDriverFacade::shouldReceive('driver->chat') ->once() ->andReturn($dto); diff --git a/tests/Feature/SearchAndSummarizeTest.php b/tests/Feature/SearchAndSummarizeTest.php index f8481f74..85b582be 100644 --- a/tests/Feature/SearchAndSummarizeTest.php +++ b/tests/Feature/SearchAndSummarizeTest.php @@ -81,14 +81,14 @@ public function test_gets_user_input() 'body' => 'Results Before this one', 'role' => RoleEnum::User, 'is_chat_ignored' => false, - 'chat_id'=> $chat->id + 'chat_id' => $chat->id, ]); $messageAssistant = Message::factory()->create([ 'body' => 'Results Before this one', 'role' => RoleEnum::Assistant, 'is_chat_ignored' => false, - 'chat_id'=> $chat->id + 'chat_id' => $chat->id, ]); $document = Document::factory()->create([ diff --git a/tests/fixtures/latest_content_prompt.txt b/tests/fixtures/latest_content_prompt.txt index 89a659fa..eb968e43 100644 --- a/tests/fixtures/latest_content_prompt.txt +++ b/tests/fixtures/latest_content_prompt.txt @@ -1,7 +1,7 @@ -Minima vel perspiciatis ullam ratione. Deserunt id ratione et totam sed eligendi. Inventore qui temporibus est ducimus. Architecto autem animi aut quam in. +Nihil quam totam fugit. Est quo earum sapiente sint est tempora deleniti omnis. Dolor velit consectetur itaque sequi a. Libero labore velit repellendus maiores. ***below is the context to use in your summary*** -Rerum impedit tenetur delectus et consectetur omnis eius voluptates. -Sapiente expedita ut omnis quibusdam voluptatum quia necessitatibus veniam nemo quam magni. -Vero sed neque eaque molestias sit asperiores consequuntur voluptatem. -Tenetur ullam omnis corrupti similique dolores illo iure. -Debitis non doloribus odio laborum perspiciatis optio quo nulla ut. \ No newline at end of file +Aut eum quia optio iste cupiditate omnis accusamus omnis autem non est et doloribus. +Quam sit eos et voluptates vel quo. +Deserunt est harum quia adipisci accusantium omnis itaque quia quasi. +Laudantium officiis et ut iusto perspiciatis dolorem quisquam et sunt ut fugit est. +Commodi quis nulla qui omnis accusamus expedita dolorum beatae dolore velit dolorum laborum est. \ No newline at end of file