-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making progress on the reporting tool
- Loading branch information
Showing
20 changed files
with
418 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
app/Domains/Prompts/ReportBuildingFindRequirementsPrompt.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Domains\Prompts; | ||
|
||
use Illuminate\Support\Facades\Log; | ||
|
||
class ReportBuildingFindRequirementsPrompt | ||
{ | ||
public static function prompt(string $context, string $userPrompt, string $collectionDescription): string | ||
{ | ||
Log::info('[LaraChain] - ReportBuildingPrompt'); | ||
|
||
return <<<PROMPT | ||
**Role** | ||
You are a report builder. There are multiple steps to this process. This step will be | ||
taking a page and finding all the requirements for the report. | ||
**Task** | ||
Use the CONTEXT as the page that as the requests of the report. It is one page in many. | ||
Then pull out each requirement so that the results can be used in the next step. | ||
**Format** | ||
The results should be text as paragraphs. Each paragraph should be a requirement. | ||
The results will be passed to the next step. All of this as a JSON array of objects. | ||
** Example ** | ||
[ | ||
{ | ||
"title": "[REQUEST 1 TITLE]", | ||
"content": "[REQUEST 1 CONTENT]" | ||
}, | ||
{ | ||
"title": "[REQUEST 2 TITLE]", | ||
"content": "[REQUEST 2 CONTENT]" | ||
} | ||
] | ||
** End Example ** | ||
** User Prompt ** | ||
$userPrompt | ||
$collectionDescription | ||
** Standards ** | ||
$context | ||
PROMPT; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Illuminate\Database\Eloquent\Relations\BelongsTo; | ||
|
||
class Section extends Model | ||
{ | ||
use HasFactory; | ||
|
||
protected $guarded = []; | ||
|
||
public function document(): BelongsTo | ||
{ | ||
return $this->belongsTo(Document::class); | ||
} | ||
|
||
public function report(): BelongsTo | ||
{ | ||
return $this->belongsTo(Report::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\Document; | ||
use App\Models\Report; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Section> | ||
*/ | ||
class SectionFactory extends Factory | ||
{ | ||
/** | ||
* Define the model's default state. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
public function definition(): array | ||
{ | ||
return [ | ||
'subject' => $this->faker->sentence(), | ||
'content' => $this->faker->paragraph(), | ||
'response' => $this->faker->paragraph(), | ||
'sort_order' => $this->faker->numberBetween(0, 100), | ||
'document_id' => Document::factory(), | ||
'report_id' => Report::factory(), | ||
]; | ||
} | ||
} |
Oops, something went wrong.