Skip to content

Commit

Permalink
did not add complete to text
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Jun 12, 2024
1 parent 19effad commit 2b82649
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Modules/LlmDriver/app/Orchestrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace LlmLaraHub\LlmDriver;

use App\Domains\Documents\StatusEnum;
use App\Domains\Messages\RoleEnum;
use App\Models\Chat;
use App\Models\Filter;
Expand Down Expand Up @@ -157,6 +158,7 @@ function ($message) {

$this->requiresFollowUp($messagesArray, $chat);

notify_ui_complete($chat);
return $this->response;
}

Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/TextDocumentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Domains\Documents\StatusEnum;
use App\Domains\Documents\TypesEnum;
use App\Helpers\TextChunker;
use App\Jobs\DocumentProcessingCompleteJob;
use App\Jobs\VectorlizeDataJob;
use App\Models\Collection;
use App\Models\Document;
Expand Down Expand Up @@ -69,6 +70,7 @@ public function store(Collection $collection, Request $request)
->name("Chunking Document - $document->file_path")
->finally(function (Batch $batch) use ($document) {
TagDocumentJob::dispatch($document);
DocumentProcessingCompleteJob::dispatch($document);
})
->allowFailures()
->dispatch();
Expand Down
15 changes: 15 additions & 0 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@ function token_counter_v2(string $text)
}
}

if (! function_exists('notify_ui_complete')) {
function notify_ui_complete(HasDrivers $model)
{
try {
ChatUiUpdateEvent::dispatch(
$model->getChatable(),
$model->getChat(),
\App\Domains\Documents\StatusEnum::Complete->name
);
} catch (\Exception $e) {
Log::error('Error notifying UI', ['error' => $e->getMessage()]);
}
}
}

if (! function_exists('notify_ui')) {
function notify_ui(HasDrivers $model, string $message)
{
Expand Down
5 changes: 3 additions & 2 deletions resources/js/Pages/Auth/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ const submit = () => {
<div>
<InputLabel for="email" value="Email" />
<TextInput
id="email" type="email" class="input input-secondary" v-model="form.email" required autofocus autocomplete="username" />
id="email" type="email" class="w-full input input-secondary" v-model="form.email" required autofocus autocomplete="username" />
<InputError class="mt-2" :message="form.errors.email" />
</div>
<div class="mt-4" v-if="usePassword">
<InputLabel for="password" value="Password" />
<TextInput id="password" type="password" class="input input-secondary" v-model="form.password" required autocomplete="current-password" />
<TextInput id="password" type="password"
class="w-full input input-secondary" v-model="form.password" required autocomplete="current-password" />
<InputError class="mt-2" :message="form.errors.password" />


Expand Down

0 comments on commit 2b82649

Please sign in to comment.