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 252
252
throw new InvalidConfigurationException ('Model name cannot be empty. ' );
253
253
}
254
254
255
+ if (isset ($ parsed ['scheme ' ])) {
256
+ $ model = $ parsed ['scheme ' ].': ' .$ model ;
257
+ }
258
+
255
259
if (isset ($ parsed ['query ' ])) {
256
260
// If options array is also provided, throw an error
257
261
if ([] !== $ options ) {
659
663
throw new InvalidConfigurationException ('Model name cannot be empty. ' );
660
664
}
661
665
666
+ if (isset ($ parsed ['scheme ' ])) {
667
+ $ model = $ parsed ['scheme ' ].': ' .$ model ;
668
+ }
669
+
662
670
if (isset ($ parsed ['query ' ])) {
663
671
// If options array is also provided, throw an error
664
672
if ([] !== $ options ) {
Original file line number Diff line number Diff line change @@ -2518,6 +2518,53 @@ public function testComprehensiveMultiAgentHappyPath()
2518
2518
$ this ->assertTrue ($ container ->hasDefinition ('ai.tool.agent_processor.orchestrator ' ));
2519
2519
}
2520
2520
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
+
2521
2568
private function buildContainer (array $ configuration ): ContainerBuilder
2522
2569
{
2523
2570
$ container = new ContainerBuilder ();
You can’t perform that action at this time.
0 commit comments