<?php
namespace Claromentis\Core\Ai\Adapters\Vertex\Requests\Text;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("_d1071a03" . "2215f0eb5" . "c4a8ef175" . "f7049d" => base64_decode("cm9sZ" . "Q=="), "_9961f986823b4be7f5c4cc8379c" . "6b228" => base64_decode("cG" . "Fy" . "dH" . "M="), "_e155674" . "41c24cf5" . "97f08568" . "9c722c66" . "0" => base64_decode("bWltZVR5cGU" . "="), "_0781363cd4daa" . "531106ac6b67b8" . "11829" => base64_decode("Z2VuZXJhdGlvbkN" . "vbmZpZw=="), "_d34599daeb8cc" . "a374d3adb38b24" . "5839c" => base64_decode("Y29udGVudHM" . "="), "_a51236f5e7f12cf84a" . "776152098d24a9" => base64_decode("dGV4" . "dA=="), "da" . "ta" => base64_decode("ZGF0YQ" . "=="), "_1a501ec32ec3319bc8449027" . "8b6d5b2d" => base64_decode("c2FmZXR5U" . "2V0dGluZ3" . "M="), "_1f4edb93cab26c83cc0d47" . "81a862f103" => base64_decode("aW5saW5lRG" . "F0YQ=="));
use BadMethodCallException;
use Claromentis\Core\Ai\Adapters\Vertex\Helpers\VertexAiModels;
use Claromentis\Core\Ai\AiRequestInterface;
use Claromentis\Core\Ai\Parts\FilePart;
use Claromentis\Core\Ai\Parts\PartInterface;
use Claromentis\Core\Ai\Parts\TextPart;
use Webmozart\Assert\Assert;




class VertexAiTextRequest implements AiRequestInterface
{
    
    
    
    
    private array $parts;
    
    
    
    
    private string $modelName;
    
    
    
    
    private bool $streaming;
    
    
    
    
    
    
    private VertexAiGenerationConfig $generationConfig;
    
    
    
    
    
    
    private VertexAiSafetySettings $safetySettings;
    
    
    
    
    
    
    
    
    public function __construct(array $_9961f986823b4be7f5c4cc8379c6b228, string $_c4bd72eb2cf14a125b21eb1fa39a0ae6, $_f407198d2ae7d5f41a9b5f94e136efe9 = false, ?VertexAiGenerationConfig $_2dbf4e0b263d86e932ed03b9c042b717 = null, ?VertexAiSafetySettings $_93d1c928df9ff3f3d5f83c4ac4830112 = null)
    {
        Assert::allIsInstanceOf($_9961f986823b4be7f5c4cc8379c6b228, PartInterface::class);
        $this->parts = $_9961f986823b4be7f5c4cc8379c6b228;
        $this->modelName = $_c4bd72eb2cf14a125b21eb1fa39a0ae6;
        $this->streaming = $_f407198d2ae7d5f41a9b5f94e136efe9;
        $this->generationConfig = $_2dbf4e0b263d86e932ed03b9c042b717 ?? new VertexAiGenerationConfig();
        $this->safetySettings = $_93d1c928df9ff3f3d5f83c4ac4830112 ?? new VertexAiSafetySettings();
    }
    public function isStreaming() : bool
    {
        return $this->streaming;
    }
    public function getModelName() : string
    {
        return $this->modelName;
    }
    public function getGenerationConfig() : VertexAiGenerationConfig
    {
        return $this->generationConfig;
    }
    public function getSafetySettings() : VertexAiSafetySettings
    {
        return $this->safetySettings;
    }
    public function serialize() : array
    {
        
        
        
        
        $_9961f986823b4be7f5c4cc8379c6b228 = $this->parts;
        $data = [];
        switch ($this->modelName) {
            case VertexAiModels::MODEL_GEMINI_PRO_1_5:
            case VertexAiModels::MODEL_GEMINI_FLASH_2_0:
            case VertexAiModels::MODEL_GEMINI_FLASH_2_5:
                foreach ($_9961f986823b4be7f5c4cc8379c6b228 as $_d962cfd1735adb2dfba46f69c7f15cb8) {
                    if ($_d962cfd1735adb2dfba46f69c7f15cb8 instanceof TextPart) {
                        $_d34599daeb8cca374d3adb38b245839c = [$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_d1071a032215" . "f0eb5c4a8ef17" . "5f7049d"] => $_d962cfd1735adb2dfba46f69c7f15cb8->getRole(), $GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_9961f986823b4be7f5c4cc8379c" . "6b228"] => [[$GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_a51236f5e7f12c" . "f84a776152098d2" . "4a9"] => $_d962cfd1735adb2dfba46f69c7f15cb8->getValue()]]];
                    } else {
                        if ($_d962cfd1735adb2dfba46f69c7f15cb8 instanceof FilePart) {
                            $_d34599daeb8cca374d3adb38b245839c = [$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_d1071a032215f0eb5c4a8ef175f704" . "9d"] => $_d962cfd1735adb2dfba46f69c7f15cb8->getRole(), $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_9961f986823b4be7f5c4cc8379c6b" . "228"] => [[$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_1f4edb93cab2" . "6c83cc0d4781a" . "862f103"] => [$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_e15567441c24cf597f08" . "5689c722c660"] => $_d962cfd1735adb2dfba46f69c7f15cb8->getMimeType(), $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["da" . "ta"] => $_d962cfd1735adb2dfba46f69c7f15cb8->getValue()]]]];
                        }
                    }
                    $data[$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_d34599da" . "eb8cca374" . "d3adb38b2" . "45839c"]][] = $_d34599daeb8cca374d3adb38b245839c;
                }
                break;
        }
        $data[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_0781363cd4daa531106ac6b67" . "b811829"]] = $this->generationConfig->serialize();
        $data[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_1a501ec32ec3" . "319bc84490278" . "b6d5b2d"]] = $this->safetySettings->serialize();
        return $data;
    }
    
    
    
    
    
    
    public function unserialize($data)
    {
        throw new BadMethodCallException();
    }
}