[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

(no description)

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

Defines 1 class

AfterGenerateResultEvent:: (6 methods):
  __construct()
  getMessages()
  getModel()
  getCapability()
  getResult()
  __clone()


Class: AfterGenerateResultEvent  - X-Ref

Event dispatched after a prompt has been sent to the AI model and a response received.

This event allows listeners to inspect the result of the model call for logging,
analytics, or other post-processing purposes. The result object is immutable.

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

param: list<Message> $messages The messages that were sent to the model.
param: ModelInterface $model The model that processed the prompt.
param: CapabilityEnum|null $capability The capability that was used for generation.
param: GenerativeAiResult $result The result from the model.

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

return: list<Message> The messages.

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

return: ModelInterface The model.

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

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

getResult()   X-Ref
Gets the result from the model.

return: GenerativeAiResult The result.

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

This method ensures that message and result 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