[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Results/DTO/ -> Candidate.php (summary)

(no description)

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

Defines 1 class

Candidate:: (7 methods):
  __construct()
  getMessage()
  getFinishReason()
  getJsonSchema()
  toArray()
  fromArray()
  __clone()


Class: Candidate  - X-Ref

Represents a candidate response from an AI model.

When generating content, AI models can produce multiple candidates.
Each candidate contains a message and metadata about why generation stopped.

__construct(Message $message, FinishReasonEnum $finishReason)   X-Ref
Constructor.

param: Message $message The generated message.
param: FinishReasonEnum $finishReason The reason generation stopped.

getMessage()   X-Ref
Gets the generated message.

return: Message The message.

getFinishReason()   X-Ref
Gets the finish reason.

return: FinishReasonEnum The finish reason.

getJsonSchema()   X-Ref
{@inheritDoc}


toArray()   X-Ref
{@inheritDoc}

return: CandidateArrayShape

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


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

This method ensures that the message object is cloned to prevent
modifications to the cloned candidate from affecting the original.




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