[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/php-ai-client/src/Providers/Models/DTO/ -> ModelConfig.php (summary)

(no description)

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

Defines 1 class

ModelConfig:: (48 methods):
  __clone()
  setOutputModalities()
  getOutputModalities()
  setSystemInstruction()
  getSystemInstruction()
  setCandidateCount()
  getCandidateCount()
  setMaxTokens()
  getMaxTokens()
  setTemperature()
  getTemperature()
  setTopP()
  getTopP()
  setTopK()
  getTopK()
  setStopSequences()
  getStopSequences()
  setPresencePenalty()
  getPresencePenalty()
  setFrequencyPenalty()
  getFrequencyPenalty()
  setLogprobs()
  getLogprobs()
  setTopLogprobs()
  getTopLogprobs()
  setFunctionDeclarations()
  getFunctionDeclarations()
  setWebSearch()
  getWebSearch()
  setOutputFileType()
  getOutputFileType()
  setOutputMimeType()
  getOutputMimeType()
  setOutputSchema()
  getOutputSchema()
  setOutputMediaOrientation()
  getOutputMediaOrientation()
  setOutputMediaAspectRatio()
  getOutputMediaAspectRatio()
  validateMediaOrientationAspectRatioCompatibility()
  setOutputSpeechVoice()
  getOutputSpeechVoice()
  setCustomOption()
  setCustomOptions()
  getCustomOptions()
  getJsonSchema()
  toArray()
  fromArray()


Class: ModelConfig  - X-Ref

Represents configuration for an AI model.

This class allows configuring various parameters for model behavior,
including output modalities, system instructions, generation parameters,
and tool integrations.

__clone()   X-Ref
Creates a deep clone of this configuration.

Clones nested objects (functionDeclarations, webSearch) to ensure
the cloned configuration is independent of the original.
Enum value objects (outputModalities, outputFileType, outputMediaOrientation)
are intentionally shared as they are immutable.


setOutputModalities(array $outputModalities)   X-Ref
Sets the output modalities.

param: list<ModalityEnum> $outputModalities The output modalities.

getOutputModalities()   X-Ref
Gets the output modalities.

return: list<ModalityEnum>|null The output modalities.

setSystemInstruction(string $systemInstruction)   X-Ref
Sets the system instruction.

param: string $systemInstruction The system instruction.

getSystemInstruction()   X-Ref
Gets the system instruction.

return: string|null The system instruction.

setCandidateCount(int $candidateCount)   X-Ref
Sets the candidate count.

param: int $candidateCount The candidate count.

getCandidateCount()   X-Ref
Gets the candidate count.

return: int|null The candidate count.

setMaxTokens(int $maxTokens)   X-Ref
Sets the maximum tokens.

param: int $maxTokens The maximum tokens.

getMaxTokens()   X-Ref
Gets the maximum tokens.

return: int|null The maximum tokens.

setTemperature(float $temperature)   X-Ref
Sets the temperature.

param: float $temperature The temperature.

getTemperature()   X-Ref
Gets the temperature.

return: float|null The temperature.

setTopP(float $topP)   X-Ref
Sets the top-p parameter.

param: float $topP The top-p parameter.

getTopP()   X-Ref
Gets the top-p parameter.

return: float|null The top-p parameter.

setTopK(int $topK)   X-Ref
Sets the top-k parameter.

param: int $topK The top-k parameter.

getTopK()   X-Ref
Gets the top-k parameter.

return: int|null The top-k parameter.

setStopSequences(array $stopSequences)   X-Ref
Sets the stop sequences.

param: list<string> $stopSequences The stop sequences.

getStopSequences()   X-Ref
Gets the stop sequences.

return: list<string>|null The stop sequences.

setPresencePenalty(float $presencePenalty)   X-Ref
Sets the presence penalty.

param: float $presencePenalty The presence penalty.

getPresencePenalty()   X-Ref
Gets the presence penalty.

return: float|null The presence penalty.

setFrequencyPenalty(float $frequencyPenalty)   X-Ref
Sets the frequency penalty.

param: float $frequencyPenalty The frequency penalty.

getFrequencyPenalty()   X-Ref
Gets the frequency penalty.

return: float|null The frequency penalty.

setLogprobs(bool $logprobs)   X-Ref
Sets whether to return log probabilities.

param: bool $logprobs Whether to return log probabilities.

getLogprobs()   X-Ref
Gets whether to return log probabilities.

return: bool|null Whether to return log probabilities.

setTopLogprobs(int $topLogprobs)   X-Ref
Sets the number of top log probabilities to return.

param: int $topLogprobs The number of top log probabilities.

getTopLogprobs()   X-Ref
Gets the number of top log probabilities to return.

return: int|null The number of top log probabilities.

setFunctionDeclarations(array $functionDeclarations)   X-Ref
Sets the function declarations.

param: list<FunctionDeclaration> $functionDeclarations The function declarations.

getFunctionDeclarations()   X-Ref
Gets the function declarations.

return: list<FunctionDeclaration>|null The function declarations.

setWebSearch(WebSearch $webSearch)   X-Ref
Sets the web search configuration.

param: WebSearch $webSearch The web search configuration.

getWebSearch()   X-Ref
Gets the web search configuration.

return: WebSearch|null The web search configuration.

setOutputFileType(FileTypeEnum $outputFileType)   X-Ref
Sets the output file type.

param: FileTypeEnum $outputFileType The output file type.

getOutputFileType()   X-Ref
Gets the output file type.

return: FileTypeEnum|null The output file type.

setOutputMimeType(string $outputMimeType)   X-Ref
Sets the output MIME type.

param: string $outputMimeType The output MIME type.

getOutputMimeType()   X-Ref
Gets the output MIME type.

return: string|null The output MIME type.

setOutputSchema(array $outputSchema)   X-Ref
Sets the output schema.

When setting an output schema, this method automatically sets
the output MIME type to "application/json" if not already set.

param: array<string, mixed> $outputSchema The output schema (JSON schema).

getOutputSchema()   X-Ref
Gets the output schema.

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

setOutputMediaOrientation(MediaOrientationEnum $outputMediaOrientation)   X-Ref
Sets the output media orientation.

param: MediaOrientationEnum $outputMediaOrientation The output media orientation.

getOutputMediaOrientation()   X-Ref
Gets the output media orientation.

return: MediaOrientationEnum|null The output media orientation.

setOutputMediaAspectRatio(string $outputMediaAspectRatio)   X-Ref
Sets the output media aspect ratio.

If set, this supersedes the output media orientation, as it is a more specific configuration.

param: string $outputMediaAspectRatio The output media aspect ratio (e.g. 3:2, 16:9).

getOutputMediaAspectRatio()   X-Ref
Gets the output media aspect ratio.

return: string|null The output media aspect ratio (e.g. 3:2, 16:9).

validateMediaOrientationAspectRatioCompatibility(MediaOrientationEnum $orientation, string $aspectRatio)   X-Ref
Validates that the given media orientation and aspect ratio values do not conflict with each other.

param: MediaOrientationEnum $orientation The desired media orientation.
param: string $aspectRatio The desired media aspect ratio.

setOutputSpeechVoice(string $outputSpeechVoice)   X-Ref
Sets the output speech voice.

param: string $outputSpeechVoice The output speech voice.

getOutputSpeechVoice()   X-Ref
Gets the output speech voice.

return: string|null The output speech voice.

setCustomOption(string $key, $value)   X-Ref
Sets a single custom option.

param: string $key   The option key.
param: mixed  $value The option value.

setCustomOptions(array $customOptions)   X-Ref
Sets the custom options.

param: array<string, mixed> $customOptions The custom options.

getCustomOptions()   X-Ref
Gets the custom options.

return: array<string, mixed> The custom options.

getJsonSchema()   X-Ref
{@inheritDoc}


toArray()   X-Ref
{@inheritDoc}

return: ModelConfigArrayShape

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




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