File tree Expand file tree Collapse file tree 11 files changed +158
-18
lines changed Expand file tree Collapse file tree 11 files changed +158
-18
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: pipeline
2
2
on : pull_request
3
3
4
4
jobs :
5
- pipeline :
5
+ tests :
6
6
runs-on : ubuntu-latest
7
7
strategy :
8
8
matrix :
28
28
- name : Install PHP Dependencies
29
29
run : composer install --no-scripts
30
30
31
+ - name : Tests
32
+ run : vendor/bin/phpunit
33
+
34
+ qa :
35
+ runs-on : ubuntu-latest
36
+ steps :
37
+ - name : Checkout
38
+ uses : actions/checkout@v4
39
+
40
+ - name : Setup PHP
41
+ uses : shivammathur/setup-php@v2
42
+ with :
43
+ php-version : ' 8.2'
44
+
45
+ - name : Install Composer
46
+ uses : " ramsey/composer-install@v3"
47
+
48
+ - name : Composer Validation
49
+ run : composer validate --strict
50
+
51
+ - name : Install PHP Dependencies
52
+ run : composer install --no-scripts
53
+
31
54
- name : Code Style PHP
32
55
run : vendor/bin/php-cs-fixer fix --dry-run
33
56
Original file line number Diff line number Diff line change 1
1
vendor
2
2
composer.lock
3
3
.php-cs-fixer.cache
4
+ .phpunit.cache
5
+ coverage
Original file line number Diff line number Diff line change 2
2
composer update --prefer-stable
3
3
vendor/bin/php-cs-fixer fix
4
4
vendor/bin/phpstan
5
+ vendor/bin/phpunit
5
6
6
7
qa-lowest :
7
8
composer update --prefer-lowest
8
9
vendor/bin/php-cs-fixer fix
9
10
vendor/bin/phpstan
11
+ vendor/bin/phpunit
12
+
13
+ qa-dev :
14
+ composer require php-llm/llm-chain:dev-main
15
+ vendor/bin/php-cs-fixer fix
16
+ vendor/bin/phpstan
17
+ vendor/bin/phpunit
18
+ # revert
19
+ git restore composer.json
20
+
21
+ coverage :
22
+ XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html=coverage
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " php-llm/llm-chain-bundle" ,
3
+ "type" : " symfony-bundle" ,
3
4
"description" : " Symfony integration bundle for php-llm/llm-chain" ,
4
5
"license" : " MIT" ,
5
- "type" : " symfony-bundle" ,
6
6
"authors" : [
7
7
{
8
8
"name" : " Christopher Hertel" ,
18
18
},
19
19
"require-dev" : {
20
20
"php-cs-fixer/shim" : " ^3.64" ,
21
- "phpstan/phpstan" : " ^1.12"
21
+ "phpstan/phpstan" : " ^1.12" ,
22
+ "phpunit/phpunit" : " ^11.3"
23
+ },
24
+ "config" : {
25
+ "sort-packages" : true
22
26
},
23
- "minimum-stability" : " dev" ,
24
- "prefer-stable" : true ,
25
27
"autoload" : {
26
28
"psr-4" : {
27
29
"PhpLlm\\ LlmChainBundle\\ " : " src/"
28
30
}
29
- }
31
+ },
32
+ "autoload-dev" : {
33
+ "psr-4" : {
34
+ "PhpLlm\\ LlmChainBundle\\ Tests\\ " : " tests/"
35
+ }
36
+ },
37
+ "minimum-stability" : " dev" ,
38
+ "prefer-stable" : true
30
39
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/11.3/phpunit.xsd"
4
+ bootstrap =" vendor/autoload.php"
5
+ cacheDirectory =" .phpunit.cache"
6
+ colors =" true"
7
+ executionOrder =" depends,defects"
8
+ requireCoverageMetadata =" true"
9
+ beStrictAboutCoverageMetadata =" true"
10
+ beStrictAboutOutputDuringTests =" true"
11
+ failOnRisky =" true"
12
+ failOnWarning =" true" >
13
+ <testsuites >
14
+ <testsuite name =" default" >
15
+ <directory >tests</directory >
16
+ </testsuite >
17
+ </testsuites >
18
+
19
+ <source ignoreIndirectDeprecations =" true" restrictNotices =" true" restrictWarnings =" true" >
20
+ <include >
21
+ <directory >src</directory >
22
+ </include >
23
+ </source >
24
+ </phpunit >
Original file line number Diff line number Diff line change 18
18
use PhpLlm \LlmChain \Store \StoreInterface ;
19
19
use PhpLlm \LlmChain \Store \VectorStoreInterface ;
20
20
use PhpLlm \LlmChain \ToolBox \AsTool ;
21
- use PhpLlm \LlmChainBundle \DataCollector ;
22
- use PhpLlm \LlmChainBundle \TraceableLanguageModel ;
23
- use PhpLlm \LlmChainBundle \TraceableToolBox ;
21
+ use PhpLlm \LlmChainBundle \Profiler \ DataCollector ;
22
+ use PhpLlm \LlmChainBundle \Profiler \ TraceableLanguageModel ;
23
+ use PhpLlm \LlmChainBundle \Profiler \ TraceableToolBox ;
24
24
use Symfony \Component \Config \FileLocator ;
25
25
use Symfony \Component \DependencyInjection \ChildDefinition ;
26
26
use Symfony \Component \DependencyInjection \ContainerBuilder ;
Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
- namespace PhpLlm \LlmChainBundle ;
5
+ namespace PhpLlm \LlmChainBundle \ Profiler ;
6
6
7
7
use PhpLlm \LlmChain \ToolBox \Metadata ;
8
8
use Symfony \Bundle \FrameworkBundle \DataCollector \AbstractDataCollector ;
17
17
final class DataCollector extends AbstractDataCollector
18
18
{
19
19
/**
20
- * @var list< TraceableLanguageModel>
20
+ * @var TraceableLanguageModel[]
21
21
*/
22
22
private readonly array $ llms ;
23
23
@@ -27,7 +27,7 @@ final class DataCollector extends AbstractDataCollector
27
27
public function __construct (
28
28
#[AutowireIterator('llm_chain.traceable_llm ' )]
29
29
iterable $ llms ,
30
- private TraceableToolBox $ toolBox ,
30
+ private readonly TraceableToolBox $ toolBox ,
31
31
) {
32
32
$ this ->llms = $ llms instanceof \Traversable ? iterator_to_array ($ llms ) : $ llms ;
33
33
}
Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
- namespace PhpLlm \LlmChainBundle ;
5
+ namespace PhpLlm \LlmChainBundle \ Profiler ;
6
6
7
7
use PhpLlm \LlmChain \LanguageModel ;
8
8
use PhpLlm \LlmChain \Message \MessageBag ;
Original file line number Diff line number Diff line change 2
2
3
3
declare (strict_types=1 );
4
4
5
- namespace PhpLlm \LlmChainBundle ;
5
+ namespace PhpLlm \LlmChainBundle \ Profiler ;
6
6
7
7
use PhpLlm \LlmChain \Response \ToolCall ;
8
- use PhpLlm \LlmChain \ToolBox \ToolBox ;
9
8
use PhpLlm \LlmChain \ToolBox \ToolBoxInterface ;
10
9
11
10
/**
@@ -22,7 +21,7 @@ final class TraceableToolBox implements ToolBoxInterface
22
21
public array $ calls = [];
23
22
24
23
public function __construct (
25
- private ToolBox $ toolRegistry ,
24
+ private ToolBoxInterface $ toolRegistry ,
26
25
) {
27
26
}
28
27
Original file line number Diff line number Diff line change 25
25
use PhpLlm \LlmChain \ToolBox \ToolAnalyzer ;
26
26
use PhpLlm \LlmChain \ToolBox \ToolBox ;
27
27
use PhpLlm \LlmChain \ToolBox \ToolBoxInterface ;
28
- use PhpLlm \LlmChainBundle \DataCollector ;
29
- use PhpLlm \LlmChainBundle \TraceableToolBox ;
28
+ use PhpLlm \LlmChainBundle \Profiler \ DataCollector ;
29
+ use PhpLlm \LlmChainBundle \Profiler \ TraceableToolBox ;
30
30
31
31
return static function (ContainerConfigurator $ container ) {
32
32
$ container ->services ()
You can’t perform that action at this time.
0 commit comments