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

Commit 26e0974

Browse files
committed
-
1 parent 8c81855 commit 26e0974

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/chat-system-prompt-tools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$systemPromptProcessor = new SystemPromptInputProcessor(
3131
'You are Yoda and write like he speaks. But short.',
3232
$toolBox,
33-
includeToolDefinitions: true
33+
includeTools: true
3434
);
3535

3636
$processor = new ChainProcessor($toolBox);

src/Chain/InputProcessor/SystemPromptInputProcessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
public function __construct(
1818
private string $systemPrompt,
1919
private ?ToolBoxInterface $toolBox = null,
20-
private bool $includeToolDefinitions = false,
20+
private bool $includeTools = false,
2121
private LoggerInterface $logger = new NullLogger(),
2222
) {
23-
if ($includeToolDefinitions && null === $toolBox) {
23+
if ($includeTools && null === $toolBox) {
2424
throw new \InvalidArgumentException('Tool definitions cannot be included without a ToolBox.');
2525
}
2626
}
@@ -37,7 +37,7 @@ public function processInput(Input $input): void
3737

3838
$message = $this->systemPrompt;
3939

40-
if ($this->includeToolDefinitions) {
40+
if ($this->includeTools) {
4141
$tools = implode(PHP_EOL.PHP_EOL, array_map(
4242
fn (Metadata $tool) => <<<TOOL
4343
## {$tool->name}

tests/Chain/InputProcessor/SystemPromptInputProcessorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function needsToolboxToBeAbleToIncludeToolDefinitions(): void
7777
new SystemPromptInputProcessor(
7878
'This is a system prompt',
7979
toolBox: null,
80-
includeToolDefinitions: true,
80+
includeTools: true,
8181
);
8282
}
8383

@@ -109,7 +109,7 @@ public function execute(ToolCall $toolCall): mixed
109109
return null;
110110
}
111111
},
112-
includeToolDefinitions: true,
112+
includeTools: true,
113113
);
114114

115115
$input = new Input(new GPT(), new MessageBag(Message::ofUser('This is a user message')), []);

0 commit comments

Comments
 (0)