WordPress\AiClient\Providers\OpenAiCompatibleImplementation
AbstractOpenAiCompatibleTextGenerationModel::prepareToolsParam
Prepares the tools parameter for the API request.
Method of the class: AbstractOpenAiCompatibleTextGenerationModel{}
No Hooks.
Returns
list
Usage
// protected - for code of main (parent) or child class $result = $this->prepareToolsParam( $functionDeclarations ): array;
- $functionDeclarations(list
) (required) - The function declarations.
Changelog
| Since 0.1.0 | Introduced. |
AbstractOpenAiCompatibleTextGenerationModel::prepareToolsParam() AbstractOpenAiCompatibleTextGenerationModel::prepareToolsParam code WP 7.0
protected function prepareToolsParam(array $functionDeclarations): array
{
$tools = [];
foreach ($functionDeclarations as $functionDeclaration) {
$tools[] = ['type' => 'function', 'function' => $functionDeclaration->toArray()];
}
return $tools;
}