trait InvokesTools

Traits

Methods

float
elapsedMilliseconds(int $startedAt)

Get the milliseconds elapsed since the given monotonic nanosecond reading.

string
executeTool(Tool $tool, array $arguments, string|null $toolCallId = null, RunContext|null $context = null)

Execute the given tool with the given arguments.

Tool|null
findTool(string $name, array $tools)

Find a tool by its name from the given tools array.

Details

in MeasuresDuration at line 12
protected float elapsedMilliseconds(int $startedAt)

Get the milliseconds elapsed since the given monotonic nanosecond reading.

Parameters

int $startedAt

Return Value

float

at line 28
protected string executeTool(Tool $tool, array $arguments, string|null $toolCallId = null, RunContext|null $context = null)

Execute the given tool with the given arguments.

Parameters

Tool $tool
array $arguments
string|null $toolCallId
RunContext|null $context

Return Value

string

at line 63
protected Tool|null findTool(string $name, array $tools)

Find a tool by its name from the given tools array.

Parameters

string $name
array $tools

Return Value

Tool|null