<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/prediction_service.proto

namespace Google\Cloud\AIPlatform\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Request message for [PredictionService.GenerateContent].
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.GenerateContentRequest</code>
 */
class GenerateContentRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The name of the publisher model requested to serve the
     * prediction. Format:
     * `projects/{project}/locations/{location}/publishers/&#42;&#47;models/&#42;`
     *
     * Generated from protobuf field <code>string model = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $model = '';
    /**
     * Required. The content of the current conversation with the model.
     * For single-turn queries, this is a single instance. For multi-turn queries,
     * this is a repeated field that contains conversation history + latest
     * request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $contents;
    /**
     * Optional. The user provided system instructions for the model.
     * Note: only text should be used in parts and content in each part will be in
     * a separate paragraph.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $system_instruction = null;
    /**
     * Optional. A list of `Tools` the model may use to generate the next
     * response.
     * A `Tool` is a piece of code that enables the system to interact with
     * external systems to perform an action, or set of actions, outside of
     * knowledge and scope of the model.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $tools;
    /**
     * Optional. Per request settings for blocking unsafe content.
     * Enforced on GenerateContentResponse.candidates.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $safety_settings;
    /**
     * Optional. Generation config.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $generation_config = null;

    /**
     * @param string                                $model    Required. The name of the publisher model requested to serve the
     *                                                        prediction. Format:
     *                                                        `projects/{project}/locations/{location}/publishers/&#42;/models/*`
     * @param \Google\Cloud\AIPlatform\V1\Content[] $contents Required. The content of the current conversation with the model.
     *
     *                                                        For single-turn queries, this is a single instance. For multi-turn queries,
     *                                                        this is a repeated field that contains conversation history + latest
     *                                                        request.
     *
     * @return \Google\Cloud\AIPlatform\V1\GenerateContentRequest
     *
     * @experimental
     */
    public static function build(string $model, array $contents): self
    {
        return (new self())
            ->setModel($model)
            ->setContents($contents);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $model
     *           Required. The name of the publisher model requested to serve the
     *           prediction. Format:
     *           `projects/{project}/locations/{location}/publishers/&#42;&#47;models/&#42;`
     *     @type array<\Google\Cloud\AIPlatform\V1\Content>|\Google\Protobuf\Internal\RepeatedField $contents
     *           Required. The content of the current conversation with the model.
     *           For single-turn queries, this is a single instance. For multi-turn queries,
     *           this is a repeated field that contains conversation history + latest
     *           request.
     *     @type \Google\Cloud\AIPlatform\V1\Content $system_instruction
     *           Optional. The user provided system instructions for the model.
     *           Note: only text should be used in parts and content in each part will be in
     *           a separate paragraph.
     *     @type array<\Google\Cloud\AIPlatform\V1\Tool>|\Google\Protobuf\Internal\RepeatedField $tools
     *           Optional. A list of `Tools` the model may use to generate the next
     *           response.
     *           A `Tool` is a piece of code that enables the system to interact with
     *           external systems to perform an action, or set of actions, outside of
     *           knowledge and scope of the model.
     *     @type array<\Google\Cloud\AIPlatform\V1\SafetySetting>|\Google\Protobuf\Internal\RepeatedField $safety_settings
     *           Optional. Per request settings for blocking unsafe content.
     *           Enforced on GenerateContentResponse.candidates.
     *     @type \Google\Cloud\AIPlatform\V1\GenerationConfig $generation_config
     *           Optional. Generation config.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\PredictionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The name of the publisher model requested to serve the
     * prediction. Format:
     * `projects/{project}/locations/{location}/publishers/&#42;&#47;models/&#42;`
     *
     * Generated from protobuf field <code>string model = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getModel()
    {
        return $this->model;
    }

    /**
     * Required. The name of the publisher model requested to serve the
     * prediction. Format:
     * `projects/{project}/locations/{location}/publishers/&#42;&#47;models/&#42;`
     *
     * Generated from protobuf field <code>string model = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setModel($var)
    {
        GPBUtil::checkString($var, True);
        $this->model = $var;

        return $this;
    }

    /**
     * Required. The content of the current conversation with the model.
     * For single-turn queries, this is a single instance. For multi-turn queries,
     * this is a repeated field that contains conversation history + latest
     * request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getContents()
    {
        return $this->contents;
    }

    /**
     * Required. The content of the current conversation with the model.
     * For single-turn queries, this is a single instance. For multi-turn queries,
     * this is a repeated field that contains conversation history + latest
     * request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Content contents = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Content>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setContents($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Content::class);
        $this->contents = $arr;

        return $this;
    }

    /**
     * Optional. The user provided system instructions for the model.
     * Note: only text should be used in parts and content in each part will be in
     * a separate paragraph.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\Content|null
     */
    public function getSystemInstruction()
    {
        return $this->system_instruction;
    }

    public function hasSystemInstruction()
    {
        return isset($this->system_instruction);
    }

    public function clearSystemInstruction()
    {
        unset($this->system_instruction);
    }

    /**
     * Optional. The user provided system instructions for the model.
     * Note: only text should be used in parts and content in each part will be in
     * a separate paragraph.
     *
     * Generated from protobuf field <code>optional .google.cloud.aiplatform.v1.Content system_instruction = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\Content $var
     * @return $this
     */
    public function setSystemInstruction($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\Content::class);
        $this->system_instruction = $var;

        return $this;
    }

    /**
     * Optional. A list of `Tools` the model may use to generate the next
     * response.
     * A `Tool` is a piece of code that enables the system to interact with
     * external systems to perform an action, or set of actions, outside of
     * knowledge and scope of the model.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTools()
    {
        return $this->tools;
    }

    /**
     * Optional. A list of `Tools` the model may use to generate the next
     * response.
     * A `Tool` is a piece of code that enables the system to interact with
     * external systems to perform an action, or set of actions, outside of
     * knowledge and scope of the model.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Tool tools = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Tool>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTools($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Tool::class);
        $this->tools = $arr;

        return $this;
    }

    /**
     * Optional. Per request settings for blocking unsafe content.
     * Enforced on GenerateContentResponse.candidates.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getSafetySettings()
    {
        return $this->safety_settings;
    }

    /**
     * Optional. Per request settings for blocking unsafe content.
     * Enforced on GenerateContentResponse.candidates.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.SafetySetting safety_settings = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\SafetySetting>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setSafetySettings($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\SafetySetting::class);
        $this->safety_settings = $arr;

        return $this;
    }

    /**
     * Optional. Generation config.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\GenerationConfig|null
     */
    public function getGenerationConfig()
    {
        return $this->generation_config;
    }

    public function hasGenerationConfig()
    {
        return isset($this->generation_config);
    }

    public function clearGenerationConfig()
    {
        unset($this->generation_config);
    }

    /**
     * Optional. Generation config.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.GenerationConfig generation_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\GenerationConfig $var
     * @return $this
     */
    public function setGenerationConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\GenerationConfig::class);
        $this->generation_config = $var;

        return $this;
    }

}

