[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Events/ -> BeforeGenerateResultEvent.php (summary)

(no description)

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

Defines 1 class

BeforeGenerateResultEvent:: (5 methods):
  __construct()
  getMessages()
  getModel()
  getCapability()
  __clone()


Class: BeforeGenerateResultEvent  - X-Ref

Event dispatched before a prompt is sent to the AI model.

This event allows listeners to inspect and modify the messages before they
are sent to the model. The event is not stoppable, meaning the model call
will always proceed regardless of listener actions.

__construct(array $messages, ModelInterface $model, ?CapabilityEnum $capability)   X-Ref
Constructor.

param: list<Message> $messages The messages to be sent to the model.
param: ModelInterface $model The model that will process the prompt.
param: CapabilityEnum|null $capability The capability being used for generation.

getMessages()   X-Ref
Gets the messages to be sent to the model.

return: list<Message> The messages.

getModel()   X-Ref
Gets the model that will process the prompt.

return: ModelInterface The model.

getCapability()   X-Ref
Gets the capability being used for generation.

return: CapabilityEnum|null The capability, or null if not specified.

__clone()   X-Ref
Performs a deep clone of the event.

This method ensures that message objects are cloned to prevent
modifications to the cloned event from affecting the original.
The model object is not cloned as it is a service object.




Generated : Sat Jun 13 09:38:55 2026 Cross-referenced by PHPXref