Skip to content

Commit c707381

Browse files
committed
minor #1155 Move fixtures to corresponding component (OskarStark)
This PR was squashed before being merged into the main branch. Discussion ---------- Move fixtures to corresponding component | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Tool fixtures belong to the agent component. Platform tests now depend on symfony/ai-agent to access them. Commits ------- edc1913 Move fixtures to corresponding component
2 parents be78cc1 + edc1913 commit c707381

File tree

63 files changed

+122
-112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+122
-112
lines changed

deptrac.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ deptrac:
55
- '#.*test.*#i'
66
- '#.*vendor.*#'
77
layers:
8+
- name: Fixtures
9+
collectors:
10+
- type: classLike
11+
value: ^Symfony\\AI\\Fixtures\\.*
812
- name: AgentComponent
913
collectors:
1014
- type: classLike
@@ -286,6 +290,7 @@ deptrac:
286290
- type: classLike
287291
value: Symfony\\AI\\Store\\Bridge\\Weaviate\\.*
288292
ruleset:
293+
Fixtures: ~
289294
AgentComponent:
290295
- PlatformComponent
291296
- StoreComponent

docs/components/platform.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,11 @@ the result back to PHP objects.
356356

357357
To achieve this, the ``Symfony\AI\Platform\StructuredOutput\PlatformSubscriber`` needs to be registered with the platform::
358358

359-
use Symfony\AI\Fixtures\StructuredOutput\MathReasoning;
360359
use Symfony\AI\Platform\Bridge\Mistral\PlatformFactory;
361360
use Symfony\AI\Platform\Message\Message;
362361
use Symfony\AI\Platform\Message\MessageBag;
363362
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
363+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\MathReasoning;
364364
use Symfony\Component\EventDispatcher\EventDispatcher;
365365

366366
$dispatcher = new EventDispatcher();

examples/anthropic/structured-output-math.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\MathReasoning;
1312
use Symfony\AI\Platform\Bridge\Anthropic\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\MathReasoning;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

examples/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
},
8484
"autoload-dev": {
8585
"psr-4": {
86-
"Symfony\\AI\\PHPStan\\": "../.phpstan/"
86+
"Symfony\\AI\\PHPStan\\": "../.phpstan/",
87+
"Symfony\\AI\\Platform\\Tests\\": "../src/platform/tests/"
8788
}
8889
},
8990
"config": {

examples/gemini/structured-output-math.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\MathReasoning;
1312
use Symfony\AI\Platform\Bridge\Gemini\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\MathReasoning;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

examples/mistral/structured-output-math.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\MathReasoning;
1312
use Symfony\AI\Platform\Bridge\Mistral\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\MathReasoning;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

examples/ollama/structured-output-math.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\MathReasoning;
1312
use Symfony\AI\Platform\Bridge\Ollama\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\MathReasoning;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

examples/openai/structured-output-list-of-polymorphic-items.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\PolymorphicType\ListOfPolymorphicTypesDto;
1312
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\PolymorphicType\ListOfPolymorphicTypesDto;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

examples/openai/structured-output-math.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\MathReasoning;
1312
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\MathReasoning;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

examples/openai/structured-output-union-types.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
* file that was distributed with this source code.
1010
*/
1111

12-
use Symfony\AI\Fixtures\StructuredOutput\UnionType\UnionTypeDto;
1312
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
1413
use Symfony\AI\Platform\Message\Message;
1514
use Symfony\AI\Platform\Message\MessageBag;
1615
use Symfony\AI\Platform\StructuredOutput\PlatformSubscriber;
16+
use Symfony\AI\Platform\Tests\Fixtures\StructuredOutput\UnionType\UnionTypeDto;
1717
use Symfony\Component\EventDispatcher\EventDispatcher;
1818

1919
require_once dirname(__DIR__).'/bootstrap.php';

0 commit comments

Comments
 (0)