Skip to content

Commit 082d444

Browse files
committed
feat: implementing basic fabric pattern wrapper
0 parents  commit 082d444

File tree

8 files changed

+1825
-0
lines changed

8 files changed

+1825
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
.phpunit.cache

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2024 Christopher Hertel
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Fabric Pattern
2+
==============
3+
4+
Slim PHP wrapper for Daniel Miessler's [fabric](https://github.com/danielmiessler/fabric) pattern library.
5+
6+
Installation
7+
------------
8+
9+
Use [Composer](https://getcomposer.org) to install the package:
10+
11+
```bash
12+
composer require php-llm/fabric-pattern
13+
```
14+
15+
On top to the PHP wrapper library this also downloads the Python repository into `vendor/danielmiessler/fabric`.
16+
17+
Usage
18+
-----
19+
20+
```php
21+
use PhpLlm\FabricPattern\Pattern;
22+
23+
// Return markdown of pattern's system prompt
24+
$pattern = (new Pattern)->load('extract_wisdom');
25+
```
26+
27+
You can find the list of available patterns [directly in fabric's repository](https://github.com/danielmiessler/fabric/tree/main/patterns).

composer.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"name": "php-llm/fabric-pattern",
3+
"type": "library",
4+
"description": "Slim PHP wrapper for Daniel Miessler's fabric pattern",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Christopher Hertel",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": ">=8.2",
14+
"danielmiessler/fabric": "^1.4"
15+
},
16+
"require-dev": {
17+
"phpunit/phpunit": "^11.2"
18+
},
19+
"autoload": {
20+
"psr-4": {
21+
"PhpLlm\\FabricPattern\\": "src/"
22+
}
23+
},
24+
"autoload-dev": {
25+
"psr-4": {
26+
"PhpLlm\\FabricPattern\\Tests\\": "tests/"
27+
}
28+
},
29+
"repositories": [
30+
{
31+
"type": "package",
32+
"package": {
33+
"name": "danielmiessler/fabric",
34+
"version": "1.4.0",
35+
"dist": {
36+
"url": "https://github.com/danielmiessler/fabric/archive/refs/tags/1.4.0.zip",
37+
"type": "zip"
38+
}
39+
}
40+
}
41+
]
42+
}

0 commit comments

Comments
 (0)