Skip to content

Commit

Permalink
going to back off this for a bit and get back to main branch and slow…
Browse files Browse the repository at this point in the history
…ly work these things in
  • Loading branch information
alnutile committed Aug 5, 2024
1 parent 514f00e commit 4cad079
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
4 changes: 1 addition & 3 deletions Modules/LlmDriver/app/Functions/SatisfyToolsRequired.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace LlmLaraHub\LlmDriver\Functions;

use App\Helpers\ChatHelperTrait;
use App\Models\Document;
use App\Models\Message;
use Illuminate\Support\Facades\Log;
use LlmLaraHub\LlmDriver\Responses\FunctionResponse;
Expand All @@ -26,9 +25,8 @@ public function handle(
{
Log::info('[LaraChain] SatisfyToolsRequired');


return FunctionResponse::from([
'content' => "Should not be called",
'content' => 'Should not be called',
'prompt' => $message->getPrompt(),
'requires_followup' => false,
'documentChunks' => collect([]),
Expand Down
1 change: 0 additions & 1 deletion Modules/LlmDriver/app/HasDrivers.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function getType(): string;

public function documents(): HasMany;


public function getChatable(): HasDrivers;

public function getChat(): ?Chat;
Expand Down
2 changes: 0 additions & 2 deletions Modules/LlmDriver/app/HasDriversTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ public function documents(): HasMany
return $this->getChatable()->documents();
}



public function systemPrompt(): string
{
return $this->getChatable()->systemPrompt();
Expand Down
1 change: 0 additions & 1 deletion Modules/LlmDriver/app/LlmServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public function boot(): void
return new SatisfyToolsRequired();
});


}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/Domains/Tokenizer/Templatizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Templatizer
protected ?string $replacement;

protected bool $appendContext = false;

protected bool $addMainCollectionPrompt = false;

public static function getTokens(): array
Expand Down Expand Up @@ -49,7 +50,7 @@ public function handle(
}
}

if($this->addMainCollectionPrompt) {
if ($this->addMainCollectionPrompt) {
$this->content = str($this->content)
->prepend(Setting::first()?->main_collection_prompt)
->toString();
Expand Down Expand Up @@ -94,6 +95,7 @@ public function appendContext(bool $appendContext = false): self
public function setMainCollectionPromptOn(): self
{
$this->addMainCollectionPrompt = true;

return $this;
}

Expand Down
2 changes: 0 additions & 2 deletions app/Models/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Illuminate\Database\Eloquent\Relations\MorphMany;
use LlmLaraHub\LlmDriver\DriversEnum;
use LlmLaraHub\LlmDriver\HasDrivers;
use LlmLaraHub\LlmDriver\HasDriversTrait;
use LlmLaraHub\TagFunction\Contracts\TaggableContract;
use LlmLaraHub\TagFunction\Helpers\Taggable;

Expand Down Expand Up @@ -49,7 +48,6 @@ public function description(): string
return $this->description;
}


public function filters(): HasMany
{
return $this->hasMany(Filter::class);
Expand Down
7 changes: 3 additions & 4 deletions database/seeders/CopySeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Database\Seeders;

use App\Models\Setting;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class CopySeeder extends Seeder
Expand All @@ -15,10 +14,10 @@ public function run(): void
{
$setting = Setting::first();

if($setting) {
if ($setting) {
$mainPrompt = $setting->main_collection_prompt;
if(!$mainPrompt) {
$prompt = <<<PROMPT
if (! $mainPrompt) {
$prompt = <<<'PROMPT'
Your primary function is to assist users in interacting with their "collection" of data within a Retrieval Augmented Generation (RAG) system. This collection comprises documents uploaded by the user or imported from web searches, serving as contextual information for our interactions.
Your responsibilities include:
1. Answering questions based on the provided context
Expand Down

0 comments on commit 4cad079

Please sign in to comment.