Skip to content

Commit fe9e0ca

Browse files
authored
Merge pull request #361 from AhmedHdeawy/fix/fix-tool-max-tries-count
Fix: Typo in Tool Max Tries Variable Name
2 parents 1b90c4b + f4b7bc9 commit fe9e0ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/HandleTools.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ trait HandleTools
3333
/**
3434
* Global max tries for all tools.
3535
*/
36-
protected int $tollMaxTries = 5;
36+
protected int $toolMaxTries = 5;
3737

3838
/**
3939
* @var array<string, int>
@@ -42,7 +42,7 @@ trait HandleTools
4242

4343
public function toolMaxTries(int $tries): Agent
4444
{
45-
$this->tollMaxTries = $tries;
45+
$this->toolMaxTries = $tries;
4646
return $this;
4747
}
4848

@@ -180,7 +180,7 @@ protected function executeSingleTool(ToolInterface $tool): void
180180
$this->toolAttempts[$tool->getName()] = ($this->toolAttempts[$tool->getName()] ?? 0) + 1;
181181

182182
// Single tool max tries have the highest priority on the global max tries.
183-
$maxTries = $tool->getMaxTries() ?? $this->tollMaxTries;
183+
$maxTries = $tool->getMaxTries() ?? $this->toolMaxTries;
184184
if ($this->toolAttempts[$tool->getName()] > $maxTries) {
185185
throw new ToolMaxTriesException("Tool {$tool->getName()} has been attempted too many times: {$maxTries} attempts.");
186186
}

src/Tools/ParallelToolCalls.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function executeTools(ToolCallMessage $toolCallMessage): ToolCallResul
4848
$this->toolAttempts[$tool->getName()] = ($this->toolAttempts[$tool->getName()] ?? 0) + 1;
4949

5050
// Single tool max tries have the highest priority over the global max tries
51-
$maxTries = $tool->getMaxTries() ?? $this->tollMaxTries;
51+
$maxTries = $tool->getMaxTries() ?? $this->toolMaxTries;
5252
if ($this->toolAttempts[$tool->getName()] > $maxTries) {
5353
throw new ToolMaxTriesException("Tool {$tool->getName()} has been attempted too many times: {$maxTries} attempts.");
5454
}

0 commit comments

Comments
 (0)