-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
808 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace App\Domains\Prompts; | ||
|
||
use Illuminate\Support\Facades\Log; | ||
|
||
class FindSolutionsPrompt | ||
{ | ||
public static function prompt(string $requirement, string $possibleSolutions, string $collectionDescription): string | ||
{ | ||
Log::info('[LaraChain] - FindSolutionsPrompt'); | ||
|
||
return <<<PROMPT | ||
### ROLE ### | ||
Role solutions finder. You will be handed a requirement then the possible strategy or strategies to solve it. | ||
### TASK ### | ||
Using the REQUIREMENT text you will see if the given Strategy is a good fit. | ||
If it is reply with a paragraph or two of text that is a solution to the requirement. | ||
Start each paragraph with a section title. | ||
If it is not just return a blank response. Some requirements are | ||
just contact info and due dates for those just highlight that info. | ||
### FORMAT ### | ||
Output is just Markdown And "" if no solution is found. | ||
### REQUIREMENT ### | ||
$requirement | ||
$collectionDescription | ||
### SOLUTION ### | ||
$possibleSolutions | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace App\Domains\Reporting; | ||
|
||
enum EntryTypeEnum: string | ||
{ | ||
case Solution = 'solution'; | ||
case Reference = 'reference'; | ||
|
||
} |
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,12 @@ | ||
<?php | ||
|
||
namespace App\Domains\Reporting; | ||
|
||
enum StatusEnum: string | ||
{ | ||
case Pending = 'pending'; | ||
case Complete = 'complete'; | ||
case Cancelled = 'cancelled'; | ||
case CompleteWithErrors = 'complete_with_errors'; | ||
case Running = 'running'; | ||
} |
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,55 @@ | ||
<?php | ||
|
||
namespace App\Events; | ||
|
||
use App\Models\Report; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Broadcasting\PrivateChannel; | ||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ReportingEvent implements ShouldBroadcast | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
*/ | ||
public function __construct( | ||
public Report $report, | ||
public string $updateMessage | ||
) { | ||
// | ||
} | ||
|
||
/** | ||
* Get the channels the event should broadcast on. | ||
* | ||
* @return array<int, \Illuminate\Broadcasting\Channel> | ||
*/ | ||
public function broadcastOn(): array | ||
{ | ||
return [ | ||
new PrivateChannel( | ||
'collection.chat.reports.'.$this->report->id), | ||
]; | ||
} | ||
|
||
public function broadcastAs(): string | ||
{ | ||
return 'update'; | ||
} | ||
|
||
public function broadcastWith(): array | ||
{ | ||
return [ | ||
'id' => $this->report->id, | ||
/** @phpstan-ignore-next-line */ | ||
'status_sections_generation' => $this->report->status_sections_generation?->value, | ||
/** @phpstan-ignore-next-line */ | ||
'status_entries_generation' => $this->report->status_entries_generation?->value, | ||
'updateMessage' => $this->updateMessage, | ||
]; | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Http\Resources\ReportResource; | ||
use App\Models\Report; | ||
|
||
class ReportController extends Controller | ||
{ | ||
public function show(Report $report) | ||
{ | ||
return response()->json([ | ||
'report' => new ReportResource($report), | ||
]); | ||
} | ||
} |
Oops, something went wrong.