Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ai-bundle/config/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
->thenInvalid(\sprintf('The model class "%%s" must extend %s.', Model::class))
->end()
->end()
->stringNode('name')->defaultNull()->end()
->stringNode('name')->isRequired()->end()
->arrayNode('options')
->variablePrototype()->end()
->end()
Expand Down Expand Up @@ -531,7 +531,7 @@
->thenInvalid(\sprintf('The model class "%%s" must extend %s.', Model::class))
->end()
->end()
->stringNode('name')->defaultNull()->end()
->stringNode('name')->isRequired()->end()
->arrayNode('options')
->variablePrototype()->end()
->end()
Expand Down
8 changes: 2 additions & 6 deletions src/ai-bundle/src/AiBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
['class' => $modelClass, 'name' => $modelName, 'options' => $options] = $config['model'];

$modelDefinition = new Definition($modelClass);
if (null !== $modelName) {
$modelDefinition->setArgument(0, $modelName);
}
$modelDefinition->setArgument(0, $modelName);
if ([] !== $options) {
$modelDefinition->setArgument(1, $options);
}
Expand Down Expand Up @@ -1105,9 +1103,7 @@ private function processVectorizerConfig(string $name, array $config, ContainerB
['class' => $modelClass, 'name' => $modelName, 'options' => $options] = $config['model'];

$modelDefinition = (new Definition((string) $modelClass));
if (null !== $modelName) {
$modelDefinition->setArgument(0, $modelName);
}
$modelDefinition->setArgument(0, $modelName);
if ([] !== $options) {
$modelDefinition->setArgument(1, $options);
}
Expand Down
Loading
Loading