File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
tests/DependencyInjection Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 271271 return $ model ;
272272 }
273273
274+ array_walk_recursive ($ options , static function (mixed &$ value ): void {
275+ if (\is_bool ($ value )) {
276+ $ value = $ value ? 'true ' : 'false ' ;
277+ }
278+ });
279+
274280 return $ model .'? ' .http_build_query ($ options );
275281 })
276282 ->end ()
698704 return $ model ;
699705 }
700706
707+ array_walk_recursive ($ options , static function (mixed &$ value ): void {
708+ if (\is_bool ($ value )) {
709+ $ value = $ value ? 'true ' : 'false ' ;
710+ }
711+ });
712+
701713 return $ model .'? ' .http_build_query ($ options );
702714 })
703715 ->end ()
Original file line number Diff line number Diff line change @@ -2583,6 +2583,58 @@ public function testVectorizerConfigurationWithColonNotation(string $model)
25832583 $ this ->assertSame ($ model , $ definition ->getArgument (1 ));
25842584 }
25852585
2586+ public function testAgentModelBooleanOptionsArePreserved ()
2587+ {
2588+ $ container = $ this ->buildContainer ([
2589+ 'ai ' => [
2590+ 'agent ' => [
2591+ 'test ' => [
2592+ 'model ' => [
2593+ 'name ' => 'qwen3 ' ,
2594+ 'options ' => [
2595+ 'stream ' => false ,
2596+ 'think ' => true ,
2597+ 'nested ' => [
2598+ 'bool ' => false ,
2599+ ],
2600+ ],
2601+ ],
2602+ ],
2603+ ],
2604+ ],
2605+ ]);
2606+
2607+ $ agentDefinition = $ container ->getDefinition ('ai.agent.test ' );
2608+
2609+ $ this ->assertSame ('qwen3?stream=false&think=true&nested%5Bbool%5D=false ' , $ agentDefinition ->getArgument (1 ));
2610+ }
2611+
2612+ public function testVectorizerModelBooleanOptionsArePreserved ()
2613+ {
2614+ $ container = $ this ->buildContainer ([
2615+ 'ai ' => [
2616+ 'vectorizer ' => [
2617+ 'test ' => [
2618+ 'model ' => [
2619+ 'name ' => 'text-embedding-3-small ' ,
2620+ 'options ' => [
2621+ 'normalize ' => false ,
2622+ 'cache ' => true ,
2623+ 'nested ' => [
2624+ 'bool ' => false ,
2625+ ],
2626+ ],
2627+ ],
2628+ ],
2629+ ],
2630+ ],
2631+ ]);
2632+
2633+ $ vectorizerDefinition = $ container ->getDefinition ('ai.vectorizer.test ' );
2634+
2635+ $ this ->assertSame ('text-embedding-3-small?normalize=false&cache=true&nested%5Bbool%5D=false ' , $ vectorizerDefinition ->getArgument (1 ));
2636+ }
2637+
25862638 private function buildContainer (array $ configuration ): ContainerBuilder
25872639 {
25882640 $ container = new ContainerBuilder ();
You can’t perform that action at this time.
0 commit comments