Skip to content

Commit 52746aa

Browse files
authored
feat: allow to use false for "no tools" (#55)
* Allow false * -
1 parent 9ffa8d4 commit 52746aa

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ llm_chain:
5050
platform: 'llm_chain.platform.anthropic'
5151
model:
5252
name: 'Claude'
53-
tools: # Unconfigured all tools are injected into the chain, use "[]" to have no tools.
53+
tools: # Unconfigured all tools are injected into the chain, use "[]" or "false" to have no tools.
5454
- 'PhpLlm\LlmChain\Chain\ToolBox\Tool\Wikipedia'
5555
store:
5656
# also azure_search, mongodb and pinecone are supported as store type

src/DependencyInjection/Configuration.php

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public function getConfigTreeBuilder(): TreeBuilder
6464
->end()
6565
->end()
6666
->arrayNode('tools')
67+
->beforeNormalization()
68+
->ifTrue(fn ($v) => false === $v)
69+
->then(fn () => [])
70+
->end()
6771
->scalarPrototype()->end()
6872
->end()
6973
->end()

0 commit comments

Comments
 (0)