AgentToolsAgent::sendProviderRequest()

Send request to agent using an AgentToolsRequest object (advanced)

Prefer this over sendRequest() for new code — the request object is self-documenting, hookable, and extensible without signature changes.

Example

$request = new AgentToolsRequest($agent);
$request->systemPrompt = 'You are a concise assistant.';
$request->messages = [['role' => 'user', 'content' => 'List templates.']];
$request->options = ['openai' => ['reasoning_effort' => 'high']];
$response = $agent->sendProviderRequest($request);

Usage

$array = $agentToolsAgent->sendProviderRequest(AgentToolsRequest $request);

Arguments

NameType(s)Description
$requestAgentToolsRequest

Return value

array

Raw provider response — check provider docs for structure


AgentToolsAgent methods and properties

API reference based on ProcessWire core version 3.0.263