Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ llm_chain:
name: 'GPT'
version: 'gpt-4o-mini'
system_prompt: 'You are a helpful assistant that can answer questions.' # The default system prompt of the chain
include_tools: true # Include tool definitions at the end of the system prompt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just added this for now as "doc"

tools:
- 'PhpLlm\LlmChain\Chain\ToolBox\Tool\SimilaritySearch'
research:
Expand Down
4 changes: 4 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public function getConfigTreeBuilder(): TreeBuilder
->defaultNull()
->info('The default system prompt of the chain')
->end()
->booleanNode('include_tools')
->info('Include tool definitions at the end of the system prompt')
->defaultFalse()
->end()
->arrayNode('tools')
->addDefaultsIfNotSet()
->treatFalseLike(['enabled' => false])
Expand Down
5 changes: 5 additions & 0 deletions src/DependencyInjection/LlmChainExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,11 @@ private function processChainConfig(string $name, array $config, ContainerBuilde
->setAutowired(true)
->setArgument('$systemPrompt', $config['system_prompt']);

if ($config['include_tools']) {
$systemPromptInputProcessorDefinition
->setArgument('$toolBox', new Reference('llm_chain.toolbox.'.$name));
}

$inputProcessors[] = $systemPromptInputProcessorDefinition;
}

Expand Down