Skip to content

Commit

Permalink
oops one letter wrecked a prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed May 5, 2024
1 parent 83c83ec commit 2cb7e62
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Domains/Agents/VerifyResponseAgent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function verify(VerifyPromptInputDto $input): VerifyPromptOutputDto
$verifyPrompt = $input->verifyPrompt;

$prompt = <<<EOT
As a date verification assistant please review the following and return
As a data verification assistant please review the following and return
a response that cleans up the original "LLM RESPONSE" included below.
What is key for you to do is that this is a RAG systems so if the original "LLM RESPONSE" response does not
line up with the data in the "CONTEXT" then remove any questionable text and
Expand Down
2 changes: 2 additions & 0 deletions app/Domains/Sources/WebSearch/Drivers/BraveSearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ class BraveSearchClient extends BaseSearchClient
{
public function search(string $search, array $options = []): SearchResponseDto
{
$count = data_get($options, 'limit', 5);

$response = $this->getClient()->get('web/search', [
'q' => urlencode($search),
'count' => $count,
]);

$video_dto = [];
Expand Down
4 changes: 4 additions & 0 deletions app/Domains/Sources/WebSearchSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public function handle(Source $source): void
$jobs[] = new GetWebContentJob($source, $web);
}

Log::info('[Larachain] Dispatching jobs to get content', [
'jobs' => count($jobs),
]);

Bus::batch($jobs)
->name("Getting Web Content for Source - {$source->title}")
->onQueue(LlmDriverFacade::driver($source->getDriver())->onQueue())
Expand Down
2 changes: 1 addition & 1 deletion app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function chunk_string(string $string, int $maxTokenSize) : array
{
$tokenCountWithBuffer = token_counter($string) * 1.25; // buffer for the response of the llm

$chunksToMake = ceil($tokenCountWithBuffer / $maxTokenSize);
$chunksToMake = ceil($tokenCountWithBuffer / $maxTokenSize) + 2; //still needs a ton of work

Check failure on line 36 in app/helpers.php

View workflow job for this annotation

GitHub Actions / ci (8.2)

Parameter #2 $length of function str_split expects int<1, max>, float given.
$chunks = str_split($string, round(strlen($string) / $chunksToMake));

Expand Down
1 change: 0 additions & 1 deletion tests/Feature/WebSearchSourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function test_searches(): void

$websource->handle($source);


Bus::assertBatchCount(1);
}

Expand Down

0 comments on commit 2cb7e62

Please sign in to comment.