WordPress\AiClient\Providers\OpenAiCompatibleImplementation

AbstractOpenAiCompatibleTextGenerationModel::prepareResponseFormatParamprotectedWP 0.1.0

Prepares the response format parameter for the API request.

This is only called if the output MIME type is application/json.

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

Хуков нет.

Возвращает

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

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->prepareResponseFormatParam( ?array $outputSchema ): array;
?array $outputSchema(обязательный)
.

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

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

Код AbstractOpenAiCompatibleTextGenerationModel::prepareResponseFormatParam() WP 7.0.4

protected function prepareResponseFormatParam(?array $outputSchema): array
{
    if (is_array($outputSchema)) {
        return ['type' => 'json_schema', 'json_schema' => $outputSchema];
    }
    return ['type' => 'json_object'];
}