-
Notifications
You must be signed in to change notification settings - Fork 0
/
laravel.nix
76 lines (65 loc) · 2.51 KB
/
laravel.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
{
inputs,
flake-parts-lib,
...
}: {
imports = [
inputs.flake-parts.flakeModules.flakeModules
];
flake.flakeModules.ai = {
options.perSystem = flake-parts-lib.mkPerSystemOption ({
lib,
pkgs,
config,
...
}: let
inherit (lib) mkIf;
inherit (import ./utils.nix {inherit lib pkgs;}) mkAi mkAiScript;
cfg = config.snow-blower.ai.laravel;
ai-laravel = mkAiScript {
name = "laravel";
system_message = '' ${cfg.prompt.message}
# Examples
${cfg.prompt.examples}'';
model = cfg.settings.model;
temperature = cfg.settings.temperature;
maxTokens = cfg.settings.maxTokens;
};
in {
options.snow-blower.ai.laravel = mkAi {
name = "Laravel";
message = '' You are a helpful assistant trained to generate Laravel commands based on the users request.
Only respond with the laravel command, NOTHING ELSE, DO NOT wrap it in quotes or backticks.'';
examples = '' user: a command that sends emails.
response: php artisan make:command SendEmails
user: a model for flights include the migration
response: php artisan make:model Flight --migration
user: a model for flights include the migration resource and request
response: php artisan make:model Flight --controller --resource --requests
user: Flight model overview
response: php artisan model:show Flight
user: Flight controller
response: php artisan make:controller FlightController
user: erase and reseed the database forefully
response: php artisan migrate:fresh --seed --force
user: what routes are avliable?
response: php artisan route:list
user: rollback migrations 5 times
response: php artisan migrate:rollback --step=5
user: start a q worker
response: php artisan queue:work'';
};
config.snow-blower = mkIf cfg.enable {
packages = [ai-laravel];
just.recipes.ai-laravel = {
enable = true;
justfile = lib.mkDefault ''
#generates a `artisan` command.
@ai-artisan:
${lib.getExe ai-laravel}
'';
};
};
});
};
}