Reference › PromptBuilder PromptBuilder::withFile ( string | WordPress\AiClient\Files\DTO\File $file , string | null $mimeType = null ): self
Since 0.1.0
Source wp-includes/php-ai-client/src/Builders/PromptBuilder.php:169Description Parameters Return Uses Source History Adds a file to the current message.
Description Accepts: <ul> <li>File object</li> <li>URL string (remote file)</li> <li>Base64-encoded data string</li> <li>Data URI string (data:mime/type;base64,data)</li> <li>Local file path string</li> </ul>
Parameters
$filestring | WordPress\AiClient\Files\DTO\FileThe file (File object or string representation).
$mimeTypestring | nulloptional The MIME type (optional, ignored if File object provided).Default: null Uses · 3 \WordPress\AiClient\Files\DTO\File::__construct() \WordPress\AiClient\Messages\DTO\MessagePart::__construct() \WordPress\AiClient\Builders\PromptBuilder::appendPartToMessages() Source View on Trac ↗ View on GitHub ↗
169 public function withFile ( $file , ? string $mimeType = null ) : self 170 { 171 $file = $file instanceof File ? $file : new File ( $file , $mimeType ) ; 172 $part = new MessagePart ( $file ) ; 173 $this -> appendPartToMessages ( $part ) ; 174 return $this ; 175 } History Introduced in 0.1.0 . Unchanged from 7.0.4 through 7.1.0.
7.0.4 7.1.0 Signature, return type and hooks compared across 2 parsed releases.
About this page Parsed data Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/php-ai-client/src/Builders/PromptBuilder.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. Corrections Something wrong on this page? Report it and it gets fixed in the next regeneration.