Skip to content

Commit

Permalink
see last message
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed May 30, 2024
1 parent 1dd0f4c commit 7f2448c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
4 changes: 1 addition & 3 deletions Modules/LlmDriver/app/Functions/SearchAndSummarize.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions app/Domains/Messages/SearchAndSummarizeChatRepo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/SearchAndSummarizeChatRepoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/SearchAndSummarizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
12 changes: 6 additions & 6 deletions tests/fixtures/latest_content_prompt.txt
Original file line number Diff line number Diff line change
@@ -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.
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.

0 comments on commit 7f2448c

Please sign in to comment.