Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit f8d536c

Browse files
committed
Add new option include_tools
1 parent 81beb5c commit f8d536c

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=8.2",
14-
"php-llm/llm-chain": "^0.16",
14+
"php-llm/llm-chain": "^0.17",
1515
"symfony/config": "^6.4 || ^7.0",
1616
"symfony/dependency-injection": "^6.4 || ^7.0",
1717
"symfony/framework-bundle": "^6.4 || ^7.0",

src/DependencyInjection/Configuration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public function getConfigTreeBuilder(): TreeBuilder
7777
->defaultNull()
7878
->info('The default system prompt of the chain')
7979
->end()
80+
->booleanNode('include_tools')
81+
->info('Include tool definitions at the end of the system prompt')
82+
->defaultFalse()
83+
->end()
8084
->arrayNode('tools')
8185
->addDefaultsIfNotSet()
8286
->treatFalseLike(['enabled' => false])

src/DependencyInjection/LlmChainExtension.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ private function processChainConfig(string $name, array $config, ContainerBuilde
296296
->setAutowired(true)
297297
->setArgument('$systemPrompt', $config['system_prompt']);
298298

299+
if ($config['include_tools']) {
300+
$systemPromptInputProcessorDefinition
301+
->setArgument('$toolBox', new Reference('llm_chain.toolbox.'.$name));
302+
}
303+
299304
$inputProcessors[] = $systemPromptInputProcessorDefinition;
300305
}
301306

0 commit comments

Comments
 (0)