Skip to content

Commit

Permalink
too big of a change! darn
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Jun 13, 2024
1 parent da2e64c commit 4f84dc2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 0 additions & 1 deletion app/Http/Controllers/ChatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ public function chat(Chat $chat)

if (data_get($validated, 'tool', null) === 'completion') {
Log::info('[LaraChain] Running Simple Completion');
$prompt = $validated['input'];

notify_ui($chat, 'We are running a completion back shortly');

Expand Down
2 changes: 2 additions & 0 deletions app/Jobs/SimpleSearchAndSummarizeOrchestrateJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\Filter;
use App\Models\PromptHistory;
use Facades\LlmLaraHub\LlmDriver\NonFunctionSearchOrSummarize;
use Illuminate\Bus\Batchable;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
Expand All @@ -19,6 +20,7 @@

class SimpleSearchAndSummarizeOrchestrateJob implements ShouldQueue
{
use Batchable;
use CreateReferencesTrait;
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

Expand Down
13 changes: 4 additions & 9 deletions tests/Feature/Http/Controllers/ChatControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
use App\Models\Message;
use App\Models\User;
use Facades\App\Domains\Agents\VerifyResponseAgent;
use Facades\LlmLaraHub\LlmDriver\NonFunctionSearchOrSummarize;
use Facades\LlmLaraHub\LlmDriver\Orchestrate;
use Illuminate\Support\Facades\Bus;
use LlmLaraHub\LlmDriver\LlmDriverFacade;
use LlmLaraHub\LlmDriver\Responses\CompletionResponse;
use LlmLaraHub\LlmDriver\Responses\NonFunctionResponseDto;
use Tests\TestCase;

class ChatControllerTest extends TestCase
Expand Down Expand Up @@ -127,6 +126,7 @@ public function test_kick_off_chat_makes_system()

public function test_no_functions()
{
Bus::fake();
$user = User::factory()->create();
$collection = Collection::factory()->create();
$chat = Chat::factory()->create([
Expand All @@ -137,13 +137,6 @@ public function test_no_functions()

LlmDriverFacade::shouldReceive('driver->hasFunctions')->once()->andReturn(false);

NonFunctionSearchOrSummarize::shouldReceive('handle')->once()->andReturn(
NonFunctionResponseDto::from([
'response' => 'Foobar',
'documentChunks' => collect(),
'prompt' => 'Foobar',
]));

$this->actingAs($user)->post(route('chats.messages.create', [
'chat' => $chat->id,
]),
Expand All @@ -152,6 +145,8 @@ public function test_no_functions()
'input' => 'user input',
])->assertOk();

Bus::assertBatchCount(1);

}

public function test_standard_checker()
Expand Down

0 comments on commit 4f84dc2

Please sign in to comment.