WordPress\AiClient\Providers\OpenAiCompatibleImplementation

AbstractOpenAiCompatibleTextGenerationModel::prepareToolsParamprotectedWP 0.1.0

Prepares the tools parameter for the API request.

Метод класса: AbstractOpenAiCompatibleTextGenerationModel{}

Хуков нет.

Возвращает

list<Массив<Строку,. mixed>> The prepared tools parameter.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->prepareToolsParam( $functionDeclarations ): array;
$functionDeclarations(list) (обязательный)
The function declarations.

Список изменений

С версии 0.1.0 Введена.

Код AbstractOpenAiCompatibleTextGenerationModel::prepareToolsParam() WP 7.0.4

protected function prepareToolsParam(array $functionDeclarations): array
{
    $tools = [];
    foreach ($functionDeclarations as $functionDeclaration) {
        $tools[] = ['type' => 'function', 'function' => $functionDeclaration->toArray()];
    }
    return $tools;
}