|
442 | 442 | ->treatNullLike(['enabled' => true]) |
443 | 443 | ->beforeNormalization() |
444 | 444 | ->ifArray() |
445 | | - ->then(function (array $v) { |
| 445 | + ->then(function (array $v): array { |
446 | 446 | return [ |
447 | 447 | 'enabled' => $v['enabled'] ?? true, |
448 | 448 | 'services' => $v['services'] ?? $v, |
|
564 | 564 | ->stringNode('table')->isRequired()->cannotBeEmpty()->end() |
565 | 565 | ->end() |
566 | 566 | ->validate() |
567 | | - ->ifTrue(static fn ($v) => !isset($v['dsn']) && !isset($v['http_client'])) |
| 567 | + ->ifTrue(static fn ($v): bool => !isset($v['dsn']) && !isset($v['http_client'])) |
568 | 568 | ->thenInvalid('Either "dsn" or "http_client" must be configured.') |
569 | 569 | ->end() |
570 | 570 | ->end() |
|
576 | 576 | ->stringNode('account_id')->cannotBeEmpty()->end() |
577 | 577 | ->stringNode('api_key')->cannotBeEmpty()->end() |
578 | 578 | ->stringNode('index_name')->cannotBeEmpty()->end() |
579 | | - ->integerNode('dimensions')->end() |
580 | | - ->stringNode('metric')->end() |
| 579 | + ->integerNode('dimensions')->isRequired()->end() |
| 580 | + ->stringNode('metric') |
| 581 | + ->cannotBeEmpty() |
| 582 | + ->defaultValue('cosine') |
| 583 | + ->end() |
581 | 584 | ->stringNode('endpoint_url')->end() |
582 | 585 | ->end() |
583 | 586 | ->end() |
|
588 | 591 | ->children() |
589 | 592 | ->stringNode('endpoint')->cannotBeEmpty()->end() |
590 | 593 | ->stringNode('table')->cannotBeEmpty()->end() |
591 | | - ->stringNode('field')->end() |
592 | | - ->stringNode('type')->end() |
593 | | - ->stringNode('similarity')->end() |
594 | | - ->integerNode('dimensions')->end() |
| 594 | + ->stringNode('field')->cannotBeEmpty()->end() |
| 595 | + ->stringNode('type')->cannotBeEmpty()->end() |
| 596 | + ->stringNode('similarity')->cannotBeEmpty()->end() |
| 597 | + ->integerNode('dimensions')->isRequired()->end() |
595 | 598 | ->stringNode('quantization')->end() |
596 | 599 | ->end() |
597 | 600 | ->end() |
598 | 601 | ->end() |
| 602 | + ->arrayNode('mariadb') |
| 603 | + ->useAttributeAsKey('name') |
| 604 | + ->arrayPrototype() |
| 605 | + ->children() |
| 606 | + ->stringNode('connection')->cannotBeEmpty()->end() |
| 607 | + ->stringNode('table_name')->cannotBeEmpty()->end() |
| 608 | + ->stringNode('index_name')->cannotBeEmpty()->end() |
| 609 | + ->stringNode('vector_field_name')->cannotBeEmpty()->end() |
| 610 | + ->arrayNode('setup_options') |
| 611 | + ->children() |
| 612 | + ->integerNode('dimensions')->end() |
| 613 | + ->end() |
| 614 | + ->end() |
| 615 | + ->end() |
| 616 | + ->end() |
| 617 | + ->end() |
599 | 618 | ->arrayNode('meilisearch') |
600 | 619 | ->useAttributeAsKey('name') |
601 | 620 | ->arrayPrototype() |
602 | 621 | ->children() |
603 | 622 | ->stringNode('endpoint')->cannotBeEmpty()->end() |
604 | 623 | ->stringNode('api_key')->cannotBeEmpty()->end() |
605 | 624 | ->stringNode('index_name')->cannotBeEmpty()->end() |
606 | | - ->stringNode('embedder')->end() |
607 | | - ->stringNode('vector_field')->end() |
608 | | - ->integerNode('dimensions')->end() |
| 625 | + ->stringNode('embedder')->cannotBeEmpty()->end() |
| 626 | + ->stringNode('vector_field')->cannotBeEmpty()->end() |
| 627 | + ->integerNode('dimensions')->isRequired()->end() |
609 | 628 | ->floatNode('semantic_ratio') |
610 | 629 | ->info('The ratio between semantic (vector) and full-text search (0.0 to 1.0). Default: 1.0 (100% semantic)') |
611 | 630 | ->defaultValue(1.0) |
|
623 | 642 | ->end() |
624 | 643 | ->end() |
625 | 644 | ->end() |
626 | | - ->arrayNode('mariadb') |
627 | | - ->useAttributeAsKey('name') |
628 | | - ->arrayPrototype() |
629 | | - ->children() |
630 | | - ->stringNode('connection')->cannotBeEmpty()->end() |
631 | | - ->stringNode('table_name')->cannotBeEmpty()->end() |
632 | | - ->stringNode('index_name')->cannotBeEmpty()->end() |
633 | | - ->stringNode('vector_field_name')->cannotBeEmpty()->end() |
634 | | - ->arrayNode('setup_options') |
635 | | - ->children() |
636 | | - ->integerNode('dimensions')->end() |
637 | | - ->end() |
638 | | - ->end() |
639 | | - ->end() |
640 | | - ->end() |
641 | | - ->end() |
642 | 645 | ->arrayNode('milvus') |
643 | 646 | ->useAttributeAsKey('name') |
644 | 647 | ->arrayPrototype() |
|
647 | 650 | ->stringNode('api_key')->isRequired()->end() |
648 | 651 | ->stringNode('database')->isRequired()->end() |
649 | 652 | ->stringNode('collection')->isRequired()->end() |
650 | | - ->stringNode('vector_field')->end() |
651 | | - ->integerNode('dimensions')->end() |
| 653 | + ->stringNode('vector_field')->isRequired()->end() |
| 654 | + ->integerNode('dimensions')->isRequired()->end() |
652 | 655 | ->stringNode('metric_type')->end() |
653 | 656 | ->end() |
654 | 657 | ->end() |
|
664 | 667 | ->stringNode('database')->isRequired()->end() |
665 | 668 | ->stringNode('collection')->isRequired()->end() |
666 | 669 | ->stringNode('index_name')->isRequired()->end() |
667 | | - ->stringNode('vector_field')->end() |
| 670 | + ->stringNode('vector_field')->isRequired()->end() |
668 | 671 | ->booleanNode('bulk_write')->end() |
669 | 672 | ->end() |
670 | 673 | ->end() |
|
679 | 682 | ->stringNode('database')->cannotBeEmpty()->end() |
680 | 683 | ->stringNode('vector_index_name')->cannotBeEmpty()->end() |
681 | 684 | ->stringNode('node_name')->cannotBeEmpty()->end() |
682 | | - ->stringNode('vector_field')->end() |
683 | | - ->integerNode('dimensions')->end() |
684 | | - ->stringNode('distance')->end() |
| 685 | + ->stringNode('vector_field')->isRequired()->end() |
| 686 | + ->integerNode('dimensions')->isRequired()->end() |
| 687 | + ->stringNode('distance')->isRequired()->end() |
685 | 688 | ->booleanNode('quantization')->end() |
686 | 689 | ->end() |
687 | 690 | ->end() |
|
696 | 699 | ->end() |
697 | 700 | ->stringNode('namespace')->end() |
698 | 701 | ->arrayNode('filter') |
699 | | - ->scalarPrototype()->end() |
| 702 | + ->scalarPrototype() |
| 703 | + ->defaultValue([]) |
| 704 | + ->end() |
700 | 705 | ->end() |
701 | 706 | ->integerNode('top_k')->end() |
702 | 707 | ->end() |
703 | 708 | ->end() |
704 | 709 | ->end() |
| 710 | + ->arrayNode('postgres') |
| 711 | + ->useAttributeAsKey('name') |
| 712 | + ->arrayPrototype() |
| 713 | + ->children() |
| 714 | + ->stringNode('dsn')->cannotBeEmpty()->end() |
| 715 | + ->stringNode('username')->end() |
| 716 | + ->stringNode('password')->end() |
| 717 | + ->stringNode('table_name')->isRequired()->end() |
| 718 | + ->stringNode('vector_field')->isRequired()->end() |
| 719 | + ->enumNode('distance') |
| 720 | + ->info('Distance metric to use for vector similarity search') |
| 721 | + ->enumFqcn(PostgresDistance::class) |
| 722 | + ->defaultValue(PostgresDistance::L2) |
| 723 | + ->end() |
| 724 | + ->stringNode('dbal_connection')->cannotBeEmpty()->end() |
| 725 | + ->end() |
| 726 | + ->validate() |
| 727 | + ->ifTrue(static fn (array $v): bool => !isset($v['dsn']) && !isset($v['dbal_connection'])) |
| 728 | + ->thenInvalid('Either "dsn" or "dbal_connection" must be configured.') |
| 729 | + ->end() |
| 730 | + ->validate() |
| 731 | + ->ifTrue(static fn (array $v): bool => isset($v['dsn'], $v['dbal_connection'])) |
| 732 | + ->thenInvalid('Either "dsn" or "dbal_connection" can be configured, but not both.') |
| 733 | + ->end() |
| 734 | + ->end() |
| 735 | + ->end() |
705 | 736 | ->arrayNode('qdrant') |
706 | 737 | ->useAttributeAsKey('name') |
707 | 738 | ->arrayPrototype() |
708 | 739 | ->children() |
709 | 740 | ->stringNode('endpoint')->cannotBeEmpty()->end() |
710 | 741 | ->stringNode('api_key')->cannotBeEmpty()->end() |
711 | 742 | ->stringNode('collection_name')->cannotBeEmpty()->end() |
712 | | - ->integerNode('dimensions')->end() |
713 | | - ->stringNode('distance')->end() |
| 743 | + ->integerNode('dimensions')->isRequired()->end() |
| 744 | + ->stringNode('distance')->isRequired()->end() |
714 | 745 | ->booleanNode('async')->end() |
715 | 746 | ->end() |
716 | 747 | ->end() |
|
736 | 767 | ->end() |
737 | 768 | ->end() |
738 | 769 | ->validate() |
739 | | - ->ifTrue(static fn ($v) => !isset($v['connection_parameters']) && !isset($v['client'])) |
| 770 | + ->ifTrue(static fn (array $v): bool => !isset($v['connection_parameters']) && !isset($v['client'])) |
740 | 771 | ->thenInvalid('Either "connection_parameters" or "client" must be configured.') |
741 | 772 | ->end() |
742 | 773 | ->validate() |
743 | | - ->ifTrue(static fn ($v) => isset($v['connection_parameters']) && isset($v['client'])) |
| 774 | + ->ifTrue(static fn (array $v): bool => isset($v['connection_parameters']) && isset($v['client'])) |
744 | 775 | ->thenInvalid('Either "connection_parameters" or "client" can be configured, but not both.') |
745 | 776 | ->end() |
746 | 777 | ->end() |
747 | 778 | ->end() |
748 | | - ->arrayNode('surreal_db') |
749 | | - ->useAttributeAsKey('name') |
750 | | - ->arrayPrototype() |
751 | | - ->children() |
752 | | - ->stringNode('endpoint')->cannotBeEmpty()->end() |
753 | | - ->stringNode('username')->cannotBeEmpty()->end() |
754 | | - ->stringNode('password')->cannotBeEmpty()->end() |
755 | | - ->stringNode('namespace')->cannotBeEmpty()->end() |
756 | | - ->stringNode('database')->cannotBeEmpty()->end() |
757 | | - ->stringNode('table')->end() |
758 | | - ->stringNode('vector_field')->end() |
759 | | - ->stringNode('strategy')->end() |
760 | | - ->integerNode('dimensions')->end() |
761 | | - ->booleanNode('namespaced_user')->end() |
762 | | - ->end() |
763 | | - ->end() |
764 | | - ->end() |
765 | 779 | ->arrayNode('supabase') |
766 | 780 | ->useAttributeAsKey('name') |
767 | 781 | ->arrayPrototype() |
|
780 | 794 | ->end() |
781 | 795 | ->end() |
782 | 796 | ->end() |
783 | | - ->arrayNode('typesense') |
| 797 | + ->arrayNode('surrealdb') |
784 | 798 | ->useAttributeAsKey('name') |
785 | 799 | ->arrayPrototype() |
786 | 800 | ->children() |
787 | 801 | ->stringNode('endpoint')->cannotBeEmpty()->end() |
788 | | - ->stringNode('api_key')->isRequired()->end() |
789 | | - ->stringNode('collection')->isRequired()->end() |
790 | | - ->stringNode('vector_field')->end() |
791 | | - ->integerNode('dimensions')->end() |
| 802 | + ->stringNode('username')->cannotBeEmpty()->end() |
| 803 | + ->stringNode('password')->cannotBeEmpty()->end() |
| 804 | + ->stringNode('namespace')->cannotBeEmpty()->end() |
| 805 | + ->stringNode('database')->cannotBeEmpty()->end() |
| 806 | + ->stringNode('table')->isRequired()->end() |
| 807 | + ->stringNode('vector_field')->isRequired()->end() |
| 808 | + ->stringNode('strategy')->isRequired()->end() |
| 809 | + ->integerNode('dimensions')->isRequired()->end() |
| 810 | + ->booleanNode('namespaced_user')->end() |
792 | 811 | ->end() |
793 | 812 | ->end() |
794 | 813 | ->end() |
795 | | - ->arrayNode('weaviate') |
| 814 | + ->arrayNode('typesense') |
796 | 815 | ->useAttributeAsKey('name') |
797 | 816 | ->arrayPrototype() |
798 | 817 | ->children() |
799 | 818 | ->stringNode('endpoint')->cannotBeEmpty()->end() |
800 | 819 | ->stringNode('api_key')->isRequired()->end() |
801 | 820 | ->stringNode('collection')->isRequired()->end() |
| 821 | + ->stringNode('vector_field')->isRequired()->end() |
| 822 | + ->integerNode('dimensions')->isRequired()->end() |
802 | 823 | ->end() |
803 | 824 | ->end() |
804 | 825 | ->end() |
805 | | - ->arrayNode('postgres') |
| 826 | + ->arrayNode('weaviate') |
806 | 827 | ->useAttributeAsKey('name') |
807 | 828 | ->arrayPrototype() |
808 | 829 | ->children() |
809 | | - ->stringNode('dsn')->cannotBeEmpty()->end() |
810 | | - ->stringNode('username')->end() |
811 | | - ->stringNode('password')->end() |
812 | | - ->stringNode('table_name')->isRequired()->end() |
813 | | - ->stringNode('vector_field')->end() |
814 | | - ->enumNode('distance') |
815 | | - ->info('Distance metric to use for vector similarity search') |
816 | | - ->enumFqcn(PostgresDistance::class) |
817 | | - ->defaultValue(PostgresDistance::L2) |
818 | | - ->end() |
819 | | - ->stringNode('dbal_connection')->cannotBeEmpty()->end() |
820 | | - ->end() |
821 | | - ->validate() |
822 | | - ->ifTrue(static fn ($v) => !isset($v['dsn']) && !isset($v['dbal_connection'])) |
823 | | - ->thenInvalid('Either "dsn" or "dbal_connection" must be configured.') |
824 | | - ->end() |
825 | | - ->validate() |
826 | | - ->ifTrue(static fn ($v) => isset($v['dsn'], $v['dbal_connection'])) |
827 | | - ->thenInvalid('Either "dsn" or "dbal_connection" can be configured, but not both.') |
| 830 | + ->stringNode('endpoint')->cannotBeEmpty()->end() |
| 831 | + ->stringNode('api_key')->isRequired()->end() |
| 832 | + ->stringNode('collection')->isRequired()->end() |
828 | 833 | ->end() |
829 | 834 | ->end() |
830 | 835 | ->end() |
|
933 | 938 | ->end() |
934 | 939 | ->end() |
935 | 940 | ->end() |
936 | | - ->arrayNode('surreal_db') |
| 941 | + ->arrayNode('surrealdb') |
937 | 942 | ->useAttributeAsKey('name') |
938 | 943 | ->arrayPrototype() |
939 | 944 | ->children() |
|
0 commit comments