WordPress\AiClient\Tools\DTO

FunctionResponse::getJsonSchemapublic staticWP 0.1.0

{@inheritDoc}

Method of the class: FunctionResponse{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = FunctionResponse::getJsonSchema(): array;

Changelog

Since 0.1.0 Introduced.

FunctionResponse::getJsonSchema() code WP 7.0.4

public static function getJsonSchema(): array
{
    return ['type' => 'object', 'properties' => [self::KEY_ID => ['type' => 'string', 'description' => 'The ID of the function call this is responding to.'], self::KEY_NAME => ['type' => 'string', 'description' => 'The name of the function that was called.'], self::KEY_RESPONSE => ['type' => ['string', 'number', 'boolean', 'object', 'array', 'null'], 'description' => 'The response data from the function.']], 'anyOf' => [['required' => [self::KEY_RESPONSE, self::KEY_ID]], ['required' => [self::KEY_RESPONSE, self::KEY_NAME]]]];
}