Skip to content

Commit 7f0a6c2

Browse files
committed
fix: Update test configurations to provide required model names
After making model names required in bundle configuration, tests need to explicitly specify model names. Updated all test cases to include 'name' parameter for both Gpt and Claude model configurations.
1 parent eccf47c commit 7f0a6c2

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

src/ai-bundle/tests/DependencyInjection/AiBundleTest.php

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function testStoreCommandsArentDefinedWithoutStore()
5353
'ai' => [
5454
'agent' => [
5555
'my_agent' => [
56-
'model' => ['class' => Gpt::class],
56+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
5757
],
5858
],
5959
],
@@ -90,7 +90,7 @@ public function testInjectionAgentAliasIsRegistered()
9090
'ai' => [
9191
'agent' => [
9292
'my_agent' => [
93-
'model' => ['class' => Gpt::class],
93+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
9494
],
9595
],
9696
],
@@ -106,7 +106,7 @@ public function testAgentHasTag()
106106
'ai' => [
107107
'agent' => [
108108
'my_agent' => [
109-
'model' => ['class' => Gpt::class],
109+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
110110
],
111111
],
112112
],
@@ -121,7 +121,7 @@ public function testAgentNameIsSetFromConfigKey()
121121
'ai' => [
122122
'agent' => [
123123
'my_custom_agent' => [
124-
'model' => ['class' => Gpt::class],
124+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
125125
],
126126
],
127127
],
@@ -150,7 +150,7 @@ public function testFaultTolerantAgentSpecificToolbox(bool $enabled)
150150
'ai' => [
151151
'agent' => [
152152
'my_agent' => [
153-
'model' => ['class' => Gpt::class],
153+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
154154
'tools' => [
155155
['service' => 'some_service', 'description' => 'Some tool'],
156156
],
@@ -171,7 +171,7 @@ public function testFaultTolerantDefaultToolbox(bool $enabled)
171171
'ai' => [
172172
'agent' => [
173173
'my_agent' => [
174-
'model' => ['class' => Gpt::class],
174+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
175175
'tools' => true,
176176
'fault_tolerant_toolbox' => $enabled,
177177
],
@@ -188,7 +188,7 @@ public function testAgentsCanBeRegisteredAsTools()
188188
'ai' => [
189189
'agent' => [
190190
'main_agent' => [
191-
'model' => ['class' => Gpt::class],
191+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
192192
'tools' => [
193193
['agent' => 'another_agent', 'description' => 'Agent tool with implicit name'],
194194
['agent' => 'another_agent', 'name' => 'another_agent_instance', 'description' => 'Agent tool with explicit name'],
@@ -209,7 +209,7 @@ public function testAgentsAsToolsCannotDefineService()
209209
'ai' => [
210210
'agent' => [
211211
'main_agent' => [
212-
'model' => ['class' => Gpt::class],
212+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
213213
'tools' => [['agent' => 'another_agent', 'service' => 'foo_bar', 'description' => 'Agent with service']],
214214
],
215215
],
@@ -359,7 +359,7 @@ public function testConfigurationWithUseAttributeAsKeyWorksWithoutNormalizeKeys(
359359
],
360360
'agent' => [
361361
'My-Agent_Name.v2' => [ // Mixed case and special chars in key
362-
'model' => ['class' => Gpt::class],
362+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
363363
],
364364
],
365365
'store' => [
@@ -391,7 +391,7 @@ public function testProcessorTagsUseFullAgentId()
391391
'ai' => [
392392
'agent' => [
393393
'test_agent' => [
394-
'model' => ['class' => Gpt::class],
394+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
395395
'tools' => [
396396
['service' => 'some_tool', 'description' => 'Test tool'],
397397
],
@@ -443,14 +443,14 @@ public function testMultipleAgentsWithProcessors()
443443
'ai' => [
444444
'agent' => [
445445
'first_agent' => [
446-
'model' => ['class' => Gpt::class],
446+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
447447
'tools' => [
448448
['service' => 'tool_one', 'description' => 'Tool for first agent'],
449449
],
450450
'prompt' => 'First agent prompt',
451451
],
452452
'second_agent' => [
453-
'model' => ['class' => Claude::class],
453+
'model' => ['class' => Claude::class, 'name' => 'claude-3-opus-20240229'],
454454
'tools' => [
455455
['service' => 'tool_two', 'description' => 'Tool for second agent'],
456456
],
@@ -494,7 +494,7 @@ public function testDefaultToolboxProcessorTags()
494494
'ai' => [
495495
'agent' => [
496496
'agent_with_default_toolbox' => [
497-
'model' => ['class' => Gpt::class],
497+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
498498
'tools' => true,
499499
],
500500
],
@@ -543,7 +543,7 @@ public function testTokenUsageProcessorTags()
543543
'agent' => [
544544
'tracked_agent' => [
545545
'platform' => 'ai.platform.openai',
546-
'model' => ['class' => Gpt::class],
546+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
547547
'track_token_usage' => true,
548548
],
549549
],
@@ -664,7 +664,7 @@ public function testSystemPromptWithArrayStructure()
664664
'ai' => [
665665
'agent' => [
666666
'test_agent' => [
667-
'model' => ['class' => Gpt::class],
667+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
668668
'prompt' => [
669669
'text' => 'You are a helpful assistant.',
670670
'enable_translation' => true,
@@ -695,7 +695,7 @@ public function testSystemPromptWithIncludeToolsEnabled()
695695
'ai' => [
696696
'agent' => [
697697
'test_agent' => [
698-
'model' => ['class' => Gpt::class],
698+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
699699
'prompt' => [
700700
'text' => 'You are a helpful assistant.',
701701
'include_tools' => true,
@@ -724,7 +724,7 @@ public function testSystemPromptWithOnlyTextKey()
724724
'ai' => [
725725
'agent' => [
726726
'test_agent' => [
727-
'model' => ['class' => Gpt::class],
727+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
728728
'prompt' => [
729729
'text' => 'You are a helpful assistant.',
730730
],
@@ -751,7 +751,7 @@ public function testAgentWithoutSystemPrompt()
751751
'ai' => [
752752
'agent' => [
753753
'test_agent' => [
754-
'model' => ['class' => Gpt::class],
754+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
755755
],
756756
],
757757
],
@@ -768,7 +768,7 @@ public function testValidSystemPromptCreatesProcessor()
768768
'ai' => [
769769
'agent' => [
770770
'test_agent' => [
771-
'model' => ['class' => Gpt::class],
771+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
772772
'prompt' => [
773773
'text' => 'Valid prompt',
774774
'include_tools' => true,
@@ -800,7 +800,7 @@ public function testEmptyTextInArrayThrowsException()
800800
'ai' => [
801801
'agent' => [
802802
'test_agent' => [
803-
'model' => ['class' => Gpt::class],
803+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
804804
'prompt' => [
805805
'text' => '',
806806
],
@@ -820,7 +820,7 @@ public function testSystemPromptArrayWithoutTextKeyThrowsException()
820820
'ai' => [
821821
'agent' => [
822822
'test_agent' => [
823-
'model' => ['class' => Gpt::class],
823+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
824824
'prompt' => [
825825
'include_tools' => true,
826826
],
@@ -837,7 +837,7 @@ public function testSystemPromptWithStringFormat()
837837
'ai' => [
838838
'agent' => [
839839
'test_agent' => [
840-
'model' => ['class' => Gpt::class],
840+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
841841
'prompt' => 'You are a helpful assistant.',
842842
'tools' => [
843843
['service' => 'some_tool', 'description' => 'Test tool'],
@@ -862,7 +862,7 @@ public function testMemoryProviderConfiguration()
862862
'ai' => [
863863
'agent' => [
864864
'test_agent' => [
865-
'model' => ['class' => Gpt::class],
865+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
866866
'memory' => 'Static memory for testing',
867867
'prompt' => [
868868
'text' => 'You are a helpful assistant.',
@@ -897,7 +897,7 @@ public function testAgentWithoutMemoryConfiguration()
897897
'ai' => [
898898
'agent' => [
899899
'test_agent' => [
900-
'model' => ['class' => Gpt::class],
900+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
901901
'prompt' => [
902902
'text' => 'You are a helpful assistant.',
903903
],
@@ -916,7 +916,7 @@ public function testMemoryWithNullValueDoesNotCreateProcessor()
916916
'ai' => [
917917
'agent' => [
918918
'test_agent' => [
919-
'model' => ['class' => Gpt::class],
919+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
920920
'memory' => null,
921921
'prompt' => [
922922
'text' => 'You are a helpful assistant.',
@@ -936,7 +936,7 @@ public function testMemoryWithSystemPromptAndTools()
936936
'ai' => [
937937
'agent' => [
938938
'test_agent' => [
939-
'model' => ['class' => Gpt::class],
939+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
940940
'memory' => 'conversation_memory_service',
941941
'prompt' => [
942942
'text' => 'You are a helpful assistant.',
@@ -979,7 +979,7 @@ public function testMemoryWithStringPromptFormat()
979979
'ai' => [
980980
'agent' => [
981981
'test_agent' => [
982-
'model' => ['class' => Gpt::class],
982+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
983983
'prompt' => 'You are a helpful assistant.',
984984
// memory cannot be configured with string format
985985
],
@@ -1001,20 +1001,20 @@ public function testMultipleAgentsWithDifferentMemoryConfigurations()
10011001
'ai' => [
10021002
'agent' => [
10031003
'agent_with_memory' => [
1004-
'model' => ['class' => Gpt::class],
1004+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
10051005
'memory' => 'first_memory_service',
10061006
'prompt' => [
10071007
'text' => 'Agent with memory.',
10081008
],
10091009
],
10101010
'agent_without_memory' => [
1011-
'model' => ['class' => Claude::class],
1011+
'model' => ['class' => Claude::class, 'name' => 'claude-3-opus-20240229'],
10121012
'prompt' => [
10131013
'text' => 'Agent without memory.',
10141014
],
10151015
],
10161016
'agent_with_different_memory' => [
1017-
'model' => ['class' => Gpt::class],
1017+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
10181018
'memory' => 'second_memory_service',
10191019
'prompt' => [
10201020
'text' => 'Agent with different memory.',
@@ -1056,7 +1056,7 @@ public function testMemoryProcessorUsesCorrectClass()
10561056
'ai' => [
10571057
'agent' => [
10581058
'test_agent' => [
1059-
'model' => ['class' => Gpt::class],
1059+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
10601060
'memory' => 'my_memory_service',
10611061
'prompt' => [
10621062
'text' => 'You are a helpful assistant.',
@@ -1094,7 +1094,7 @@ public function testEmptyStringMemoryConfigurationThrowsException()
10941094
'ai' => [
10951095
'agent' => [
10961096
'test_agent' => [
1097-
'model' => ['class' => Gpt::class],
1097+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
10981098
'memory' => '',
10991099
'prompt' => [
11001100
'text' => 'Test prompt',
@@ -1115,7 +1115,7 @@ public function testMemoryArrayConfigurationWithoutServiceKeyThrowsException()
11151115
'ai' => [
11161116
'agent' => [
11171117
'test_agent' => [
1118-
'model' => ['class' => Gpt::class],
1118+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
11191119
'memory' => ['invalid' => 'value'],
11201120
'prompt' => [
11211121
'text' => 'Test prompt',
@@ -1136,7 +1136,7 @@ public function testMemoryArrayConfigurationWithEmptyServiceThrowsException()
11361136
'ai' => [
11371137
'agent' => [
11381138
'test_agent' => [
1139-
'model' => ['class' => Gpt::class],
1139+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
11401140
'memory' => ['service' => ''],
11411141
'prompt' => [
11421142
'text' => 'Test prompt',
@@ -1154,7 +1154,7 @@ public function testMemoryServiceConfigurationWorksCorrectly()
11541154
'ai' => [
11551155
'agent' => [
11561156
'test_agent' => [
1157-
'model' => ['class' => Gpt::class],
1157+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
11581158
'memory' => ['service' => 'my_custom_memory_service'],
11591159
'prompt' => [
11601160
'text' => 'Test prompt',
@@ -1181,7 +1181,7 @@ public function testMemoryProcessorPriorityOrdering()
11811181
'ai' => [
11821182
'agent' => [
11831183
'test_agent' => [
1184-
'model' => ['class' => Gpt::class],
1184+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
11851185
'memory' => 'test_memory',
11861186
'prompt' => [
11871187
'text' => 'Test prompt',
@@ -1210,7 +1210,7 @@ public function testMemoryProcessorIntegration()
12101210
'ai' => [
12111211
'agent' => [
12121212
'test_agent' => [
1213-
'model' => ['class' => Gpt::class],
1213+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
12141214
'memory' => 'my_memory_service',
12151215
'prompt' => [
12161216
'text' => 'You are a helpful assistant.',
@@ -1257,7 +1257,7 @@ public function testMemoryWithExistingServiceUsesServiceReference()
12571257
'ai' => [
12581258
'agent' => [
12591259
'test_agent' => [
1260-
'model' => ['class' => Gpt::class],
1260+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
12611261
'memory' => ['service' => 'existing_memory_service'], // New array syntax for service
12621262
'prompt' => [
12631263
'text' => 'You are a helpful assistant.',
@@ -1284,7 +1284,7 @@ public function testMemoryWithNonExistingServiceCreatesStaticMemoryProvider()
12841284
'ai' => [
12851285
'agent' => [
12861286
'test_agent' => [
1287-
'model' => ['class' => Gpt::class],
1287+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
12881288
'memory' => 'This is static memory content', // This is not a service
12891289
'prompt' => [
12901290
'text' => 'You are a helpful assistant.',
@@ -1329,7 +1329,7 @@ public function testMemoryWithServiceAliasUsesAlias()
13291329
'ai' => [
13301330
'agent' => [
13311331
'test_agent' => [
1332-
'model' => ['class' => Gpt::class],
1332+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
13331333
'memory' => ['service' => 'memory_alias'], // Use new array syntax for service alias
13341334
'prompt' => [
13351335
'text' => 'You are a helpful assistant.',
@@ -1365,14 +1365,14 @@ public function testDifferentAgentsCanUseDifferentMemoryTypes()
13651365
'ai' => [
13661366
'agent' => [
13671367
'agent_with_service' => [
1368-
'model' => ['class' => Gpt::class],
1368+
'model' => ['class' => Gpt::class, 'name' => 'gpt-4'],
13691369
'memory' => ['service' => 'dynamic_memory_service'], // Use new array syntax for service
13701370
'prompt' => [
13711371
'text' => 'Agent with service.',
13721372
],
13731373
],
13741374
'agent_with_static' => [
1375-
'model' => ['class' => Claude::class],
1375+
'model' => ['class' => Claude::class, 'name' => 'claude-3-opus-20240229'],
13761376
'memory' => 'Static memory context for this agent', // Static content
13771377
'prompt' => [
13781378
'text' => 'Agent with static memory.',

0 commit comments

Comments
 (0)