Skip to content

Commit ef91b76

Browse files
authored
Merge branch 'symfony:main' into feature/fixChromaDbStore
2 parents cf7d653 + c58ddce commit ef91b76

File tree

15 files changed

+1465
-391
lines changed

15 files changed

+1465
-391
lines changed

.php-cs-fixer.dist.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
return (new PhpCsFixer\Config())
3131
// @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/7777
3232
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
33-
->setUnsupportedPhpVersionAllowed(true)
3433
->setRules([
3534
'@Symfony' => true,
3635
'@Symfony:risky' => true,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"require-dev": {
99
"php": ">=8.2",
1010
"deptrac/deptrac": "^4.2",
11-
"php-cs-fixer/shim": "^3.75",
11+
"php-cs-fixer/shim": "^3.91.2",
1212
"phpstan/phpstan-strict-rules": "^2.0",
1313
"symfony/filesystem": "^7.3|^8.0",
1414
"symfony/finder": "^7.3|^8.0"

docs/components/platform.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ than the default catalog::
8989
use Symfony\AI\Platform\Message\Message;
9090
use Symfony\AI\Platform\Message\MessageBag;
9191

92-
$platform = PlatformFactory::create('http://127.0.0.11434', HttpClient::create(), new OllamaApiCatalog(
93-
'http://127.0.0.11434',
92+
$platform = PlatformFactory::create('http://127.0.0.1:11434', HttpClient::create(), new OllamaApiCatalog(
93+
'http://127.0.0.1:11434',
9494
HttpClient::create(),
9595
));
9696

src/agent/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ https://github.com/symfony/ai to create issues or submit pull requests.
1919

2020
## Resources
2121

22-
- [Documentation](../../docs/index.rst)
22+
- [Documentation](https://symfony.com/doc/current/ai/components/agent.html)
2323
- [Report issues](https://github.com/symfony/ai/issues) and
2424
[send Pull Requests](https://github.com/symfony/ai/pulls)
2525
in the [main Symfony AI repository](https://github.com/symfony/ai)

src/agent/src/Bridge/SimilaritySearch/SimilaritySearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(
3939
public function __invoke(string $searchTerm): string
4040
{
4141
$vector = $this->vectorizer->vectorize($searchTerm);
42-
$this->usedDocuments = $this->store->query($vector);
42+
$this->usedDocuments = iterator_to_array($this->store->query($vector));
4343

4444
if ([] === $this->usedDocuments) {
4545
return 'No results found';

src/ai-bundle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ https://github.com/symfony/ai to create issues or submit pull requests.
1818

1919
## Resources
2020

21-
- [Documentation](../../docs/index.rst)
21+
- [Documentation](https://symfony.com/doc/current/ai/bundles/ai-bundle.html)
2222
- [Report issues](https://github.com/symfony/ai/issues) and
2323
[send Pull Requests](https://github.com/symfony/ai/pulls)
2424
in the [main Symfony AI repository](https://github.com/symfony/ai)

src/ai-bundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"phpstan/phpstan": "^2.1",
3838
"phpstan/phpstan-strict-rules": "^2.0",
3939
"phpunit/phpunit": "^11.5",
40+
"probots-io/pinecone-php": "^1.0",
4041
"symfony/expression-language": "^7.3|^8.0",
4142
"symfony/security-core": "^7.3|^8.0",
4243
"symfony/translation": "^7.3|^8.0"

src/ai-bundle/config/options.php

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@
669669
->stringNode('database')->isRequired()->end()
670670
->stringNode('collection')->isRequired()->end()
671671
->stringNode('index_name')->isRequired()->end()
672-
->stringNode('vector_field')->end()
672+
->stringNode('vector_field')->isRequired()->end()
673673
->booleanNode('bulk_write')->end()
674674
->end()
675675
->end()
@@ -684,9 +684,9 @@
684684
->stringNode('database')->cannotBeEmpty()->end()
685685
->stringNode('vector_index_name')->cannotBeEmpty()->end()
686686
->stringNode('node_name')->cannotBeEmpty()->end()
687-
->stringNode('vector_field')->end()
688-
->integerNode('dimensions')->end()
689-
->stringNode('distance')->end()
687+
->stringNode('vector_field')->isRequired()->end()
688+
->integerNode('dimensions')->isRequired()->end()
689+
->stringNode('distance')->isRequired()->end()
690690
->booleanNode('quantization')->end()
691691
->end()
692692
->end()
@@ -701,21 +701,49 @@
701701
->end()
702702
->stringNode('namespace')->end()
703703
->arrayNode('filter')
704-
->scalarPrototype()->end()
704+
->scalarPrototype()
705+
->defaultValue([])
706+
->end()
705707
->end()
706708
->integerNode('top_k')->end()
707709
->end()
708710
->end()
709711
->end()
712+
->arrayNode('postgres')
713+
->useAttributeAsKey('name')
714+
->arrayPrototype()
715+
->children()
716+
->stringNode('dsn')->cannotBeEmpty()->end()
717+
->stringNode('username')->end()
718+
->stringNode('password')->end()
719+
->stringNode('table_name')->isRequired()->end()
720+
->stringNode('vector_field')->isRequired()->end()
721+
->enumNode('distance')
722+
->info('Distance metric to use for vector similarity search')
723+
->enumFqcn(PostgresDistance::class)
724+
->defaultValue(PostgresDistance::L2)
725+
->end()
726+
->stringNode('dbal_connection')->cannotBeEmpty()->end()
727+
->end()
728+
->validate()
729+
->ifTrue(static fn (array $v): bool => !isset($v['dsn']) && !isset($v['dbal_connection']))
730+
->thenInvalid('Either "dsn" or "dbal_connection" must be configured.')
731+
->end()
732+
->validate()
733+
->ifTrue(static fn (array $v): bool => isset($v['dsn'], $v['dbal_connection']))
734+
->thenInvalid('Either "dsn" or "dbal_connection" can be configured, but not both.')
735+
->end()
736+
->end()
737+
->end()
710738
->arrayNode('qdrant')
711739
->useAttributeAsKey('name')
712740
->arrayPrototype()
713741
->children()
714742
->stringNode('endpoint')->cannotBeEmpty()->end()
715743
->stringNode('api_key')->cannotBeEmpty()->end()
716744
->stringNode('collection_name')->cannotBeEmpty()->end()
717-
->integerNode('dimensions')->end()
718-
->stringNode('distance')->end()
745+
->integerNode('dimensions')->isRequired()->end()
746+
->stringNode('distance')->isRequired()->end()
719747
->booleanNode('async')->end()
720748
->end()
721749
->end()
@@ -741,32 +769,15 @@
741769
->end()
742770
->end()
743771
->validate()
744-
->ifTrue(static fn ($v) => !isset($v['connection_parameters']) && !isset($v['client']))
772+
->ifTrue(static fn (array $v): bool => !isset($v['connection_parameters']) && !isset($v['client']))
745773
->thenInvalid('Either "connection_parameters" or "client" must be configured.')
746774
->end()
747775
->validate()
748-
->ifTrue(static fn ($v) => isset($v['connection_parameters']) && isset($v['client']))
776+
->ifTrue(static fn (array $v): bool => isset($v['connection_parameters']) && isset($v['client']))
749777
->thenInvalid('Either "connection_parameters" or "client" can be configured, but not both.')
750778
->end()
751779
->end()
752780
->end()
753-
->arrayNode('surreal_db')
754-
->useAttributeAsKey('name')
755-
->arrayPrototype()
756-
->children()
757-
->stringNode('endpoint')->cannotBeEmpty()->end()
758-
->stringNode('username')->cannotBeEmpty()->end()
759-
->stringNode('password')->cannotBeEmpty()->end()
760-
->stringNode('namespace')->cannotBeEmpty()->end()
761-
->stringNode('database')->cannotBeEmpty()->end()
762-
->stringNode('table')->end()
763-
->stringNode('vector_field')->end()
764-
->stringNode('strategy')->end()
765-
->integerNode('dimensions')->end()
766-
->booleanNode('namespaced_user')->end()
767-
->end()
768-
->end()
769-
->end()
770781
->arrayNode('supabase')
771782
->useAttributeAsKey('name')
772783
->arrayPrototype()
@@ -785,51 +796,42 @@
785796
->end()
786797
->end()
787798
->end()
788-
->arrayNode('typesense')
799+
->arrayNode('surrealdb')
789800
->useAttributeAsKey('name')
790801
->arrayPrototype()
791802
->children()
792803
->stringNode('endpoint')->cannotBeEmpty()->end()
793-
->stringNode('api_key')->isRequired()->end()
794-
->stringNode('collection')->isRequired()->end()
795-
->stringNode('vector_field')->end()
796-
->integerNode('dimensions')->end()
804+
->stringNode('username')->cannotBeEmpty()->end()
805+
->stringNode('password')->cannotBeEmpty()->end()
806+
->stringNode('namespace')->cannotBeEmpty()->end()
807+
->stringNode('database')->cannotBeEmpty()->end()
808+
->stringNode('table')->isRequired()->end()
809+
->stringNode('vector_field')->isRequired()->end()
810+
->stringNode('strategy')->isRequired()->end()
811+
->integerNode('dimensions')->isRequired()->end()
812+
->booleanNode('namespaced_user')->end()
797813
->end()
798814
->end()
799815
->end()
800-
->arrayNode('weaviate')
816+
->arrayNode('typesense')
801817
->useAttributeAsKey('name')
802818
->arrayPrototype()
803819
->children()
804820
->stringNode('endpoint')->cannotBeEmpty()->end()
805821
->stringNode('api_key')->isRequired()->end()
806822
->stringNode('collection')->isRequired()->end()
823+
->stringNode('vector_field')->isRequired()->end()
824+
->integerNode('dimensions')->isRequired()->end()
807825
->end()
808826
->end()
809827
->end()
810-
->arrayNode('postgres')
828+
->arrayNode('weaviate')
811829
->useAttributeAsKey('name')
812830
->arrayPrototype()
813831
->children()
814-
->stringNode('dsn')->cannotBeEmpty()->end()
815-
->stringNode('username')->end()
816-
->stringNode('password')->end()
817-
->stringNode('table_name')->isRequired()->end()
818-
->stringNode('vector_field')->end()
819-
->enumNode('distance')
820-
->info('Distance metric to use for vector similarity search')
821-
->enumFqcn(PostgresDistance::class)
822-
->defaultValue(PostgresDistance::L2)
823-
->end()
824-
->stringNode('dbal_connection')->cannotBeEmpty()->end()
825-
->end()
826-
->validate()
827-
->ifTrue(static fn (array $v): bool => !isset($v['dsn']) && !isset($v['dbal_connection']))
828-
->thenInvalid('Either "dsn" or "dbal_connection" must be configured.')
829-
->end()
830-
->validate()
831-
->ifTrue(static fn (array $v): bool => isset($v['dsn'], $v['dbal_connection']))
832-
->thenInvalid('Either "dsn" or "dbal_connection" can be configured, but not both.')
832+
->stringNode('endpoint')->cannotBeEmpty()->end()
833+
->stringNode('api_key')->isRequired()->end()
834+
->stringNode('collection')->isRequired()->end()
833835
->end()
834836
->end()
835837
->end()
@@ -951,7 +953,7 @@
951953
->end()
952954
->end()
953955
->end()
954-
->arrayNode('surreal_db')
956+
->arrayNode('surrealdb')
955957
->useAttributeAsKey('name')
956958
->arrayPrototype()
957959
->children()

0 commit comments

Comments
 (0)