[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Tools/DTO/ -> FunctionDeclaration.php (summary)

(no description)

File Size: 145 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

FunctionDeclaration:: (8 methods):
  __construct()
  getName()
  getDescription()
  getParameters()
  getAnnotations()
  getJsonSchema()
  toArray()
  fromArray()


Class: FunctionDeclaration  - X-Ref

Represents a function declaration for AI models.

This DTO describes a function that can be called by the AI model,
including its name, description, parameter schema, and optional annotations.

__construct(string $name, string $description, ?array $parameters = null, array $annotations = [])   X-Ref
Constructor.

param: string $name The name of the function.
param: string $description A description of what the function does.
param: array<string, mixed>|null $parameters The JSON schema for the function parameters.
param: array<string, mixed> $annotations Optional annotations with JSON-serializable values.

getName()   X-Ref
Gets the function name.

return: string The function name.

getDescription()   X-Ref
Gets the function description.

return: string The function description.

getParameters()   X-Ref
Gets the function parameters schema.

return: array<string, mixed>|null The parameters schema.

getAnnotations()   X-Ref
Gets the function annotations.

return: array<string, mixed> The annotations, or an empty array if none were provided.

getJsonSchema()   X-Ref
{@inheritDoc}


toArray()   X-Ref
{@inheritDoc}

return: FunctionDeclarationArrayShape

fromArray(array $array)   X-Ref
{@inheritDoc}




Generated : Sun Nov 1 08:20:35 2026 Cross-referenced by PHPXref