File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed
tests/DependencyInjection Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change 252252 throw new InvalidConfigurationException ('Model name cannot be empty. ' );
253253 }
254254
255+ if (isset ($ parsed ['scheme ' ])) {
256+ $ model = $ parsed ['scheme ' ].': ' .$ model ;
257+ }
258+
255259 if (isset ($ parsed ['query ' ])) {
256260 // If options array is also provided, throw an error
257261 if ([] !== $ options ) {
659663 throw new InvalidConfigurationException ('Model name cannot be empty. ' );
660664 }
661665
666+ if (isset ($ parsed ['scheme ' ])) {
667+ $ model = $ parsed ['scheme ' ].': ' .$ model ;
668+ }
669+
662670 if (isset ($ parsed ['query ' ])) {
663671 // If options array is also provided, throw an error
664672 if ([] !== $ options ) {
Original file line number Diff line number Diff line change @@ -2518,6 +2518,53 @@ public function testComprehensiveMultiAgentHappyPath()
25182518 $ this ->assertTrue ($ container ->hasDefinition ('ai.tool.agent_processor.orchestrator ' ));
25192519 }
25202520
2521+ #[TestDox('Agent model configuration preserves colon notation in model names (e.g., qwen3:0.6b) ' )]
2522+ #[TestWith(['qwen3:0.6b ' ])]
2523+ #[TestWith(['deepseek-r1:70b ' ])]
2524+ #[TestWith(['qwen3-coder:30b ' ])]
2525+ #[TestWith(['qwen3:0.6b?think=false ' ])]
2526+ public function testModelConfigurationWithColonNotation (string $ model )
2527+ {
2528+ $ container = $ this ->buildContainer ([
2529+ 'ai ' => [
2530+ 'agent ' => [
2531+ 'test ' => [
2532+ 'model ' => [
2533+ 'name ' => $ model ,
2534+ ],
2535+ ],
2536+ ],
2537+ ],
2538+ ]);
2539+
2540+ $ agentDefinition = $ container ->getDefinition ('ai.agent.test ' );
2541+
2542+ $ this ->assertSame ($ model , $ agentDefinition ->getArgument (1 ));
2543+ }
2544+
2545+ #[TestDox('Vectorizer model configuration preserves colon notation in model names (e.g., bge-m3:1024) ' )]
2546+ #[TestWith(['bge-m3:567m ' ])]
2547+ #[TestWith(['nomic-embed-text:137m-v1.5-fp16 ' ])]
2548+ #[TestWith(['qwen3-embedding:0.6b?normalize=true ' ])]
2549+ public function testVectorizerConfigurationWithColonNotation (string $ model )
2550+ {
2551+ $ container = $ this ->buildContainer ([
2552+ 'ai ' => [
2553+ 'vectorizer ' => [
2554+ 'test ' => [
2555+ 'model ' => [
2556+ 'name ' => $ model ,
2557+ ],
2558+ ],
2559+ ],
2560+ ],
2561+ ]);
2562+
2563+ $ definition = $ container ->getDefinition ('ai.vectorizer.test ' );
2564+
2565+ $ this ->assertSame ($ model , $ definition ->getArgument (1 ));
2566+ }
2567+
25212568 private function buildContainer (array $ configuration ): ContainerBuilder
25222569 {
25232570 $ container = new ContainerBuilder ();
You can’t perform that action at this time.
0 commit comments