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

namespace Google\Cloud\DiscoveryEngine\V1\GenerateGroundedContentRequest;

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

/**
 * Content generation specification.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.GenerateGroundedContentRequest.GenerationSpec</code>
 */
class GenerationSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies which Vertex model id to use for generation.
     *
     * Generated from protobuf field <code>string model_id = 3;</code>
     */
    protected $model_id = '';
    /**
     * Language code for content. Use language tags defined by
     * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
     *
     * Generated from protobuf field <code>string language_code = 2;</code>
     */
    protected $language_code = '';
    /**
     * If specified, custom value for the temperature will be used.
     *
     * Generated from protobuf field <code>optional float temperature = 4;</code>
     */
    protected $temperature = null;
    /**
     * If specified, custom value for nucleus sampling will be used.
     *
     * Generated from protobuf field <code>optional float top_p = 5;</code>
     */
    protected $top_p = null;
    /**
     * If specified, custom value for top-k sampling will be used.
     *
     * Generated from protobuf field <code>optional int32 top_k = 7;</code>
     */
    protected $top_k = null;
    /**
     * If specified, custom value for frequency penalty will be used.
     *
     * Generated from protobuf field <code>optional float frequency_penalty = 8;</code>
     */
    protected $frequency_penalty = null;
    /**
     * If specified, custom value for the seed will be used.
     *
     * Generated from protobuf field <code>optional int32 seed = 12;</code>
     */
    protected $seed = null;
    /**
     * If specified, custom value for presence penalty will be used.
     *
     * Generated from protobuf field <code>optional float presence_penalty = 9;</code>
     */
    protected $presence_penalty = null;
    /**
     * If specified, custom value for max output tokens will be used.
     *
     * Generated from protobuf field <code>optional int32 max_output_tokens = 10;</code>
     */
    protected $max_output_tokens = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $model_id
     *           Specifies which Vertex model id to use for generation.
     *     @type string $language_code
     *           Language code for content. Use language tags defined by
     *           [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
     *     @type float $temperature
     *           If specified, custom value for the temperature will be used.
     *     @type float $top_p
     *           If specified, custom value for nucleus sampling will be used.
     *     @type int $top_k
     *           If specified, custom value for top-k sampling will be used.
     *     @type float $frequency_penalty
     *           If specified, custom value for frequency penalty will be used.
     *     @type int $seed
     *           If specified, custom value for the seed will be used.
     *     @type float $presence_penalty
     *           If specified, custom value for presence penalty will be used.
     *     @type int $max_output_tokens
     *           If specified, custom value for max output tokens will be used.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\GroundedGenerationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Specifies which Vertex model id to use for generation.
     *
     * Generated from protobuf field <code>string model_id = 3;</code>
     * @return string
     */
    public function getModelId()
    {
        return $this->model_id;
    }

    /**
     * Specifies which Vertex model id to use for generation.
     *
     * Generated from protobuf field <code>string model_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setModelId($var)
    {
        GPBUtil::checkString($var, True);
        $this->model_id = $var;

        return $this;
    }

    /**
     * Language code for content. Use language tags defined by
     * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
     *
     * Generated from protobuf field <code>string language_code = 2;</code>
     * @return string
     */
    public function getLanguageCode()
    {
        return $this->language_code;
    }

    /**
     * Language code for content. Use language tags defined by
     * [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
     *
     * Generated from protobuf field <code>string language_code = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLanguageCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->language_code = $var;

        return $this;
    }

    /**
     * If specified, custom value for the temperature will be used.
     *
     * Generated from protobuf field <code>optional float temperature = 4;</code>
     * @return float
     */
    public function getTemperature()
    {
        return isset($this->temperature) ? $this->temperature : 0.0;
    }

    public function hasTemperature()
    {
        return isset($this->temperature);
    }

    public function clearTemperature()
    {
        unset($this->temperature);
    }

    /**
     * If specified, custom value for the temperature will be used.
     *
     * Generated from protobuf field <code>optional float temperature = 4;</code>
     * @param float $var
     * @return $this
     */
    public function setTemperature($var)
    {
        GPBUtil::checkFloat($var);
        $this->temperature = $var;

        return $this;
    }

    /**
     * If specified, custom value for nucleus sampling will be used.
     *
     * Generated from protobuf field <code>optional float top_p = 5;</code>
     * @return float
     */
    public function getTopP()
    {
        return isset($this->top_p) ? $this->top_p : 0.0;
    }

    public function hasTopP()
    {
        return isset($this->top_p);
    }

    public function clearTopP()
    {
        unset($this->top_p);
    }

    /**
     * If specified, custom value for nucleus sampling will be used.
     *
     * Generated from protobuf field <code>optional float top_p = 5;</code>
     * @param float $var
     * @return $this
     */
    public function setTopP($var)
    {
        GPBUtil::checkFloat($var);
        $this->top_p = $var;

        return $this;
    }

    /**
     * If specified, custom value for top-k sampling will be used.
     *
     * Generated from protobuf field <code>optional int32 top_k = 7;</code>
     * @return int
     */
    public function getTopK()
    {
        return isset($this->top_k) ? $this->top_k : 0;
    }

    public function hasTopK()
    {
        return isset($this->top_k);
    }

    public function clearTopK()
    {
        unset($this->top_k);
    }

    /**
     * If specified, custom value for top-k sampling will be used.
     *
     * Generated from protobuf field <code>optional int32 top_k = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setTopK($var)
    {
        GPBUtil::checkInt32($var);
        $this->top_k = $var;

        return $this;
    }

    /**
     * If specified, custom value for frequency penalty will be used.
     *
     * Generated from protobuf field <code>optional float frequency_penalty = 8;</code>
     * @return float
     */
    public function getFrequencyPenalty()
    {
        return isset($this->frequency_penalty) ? $this->frequency_penalty : 0.0;
    }

    public function hasFrequencyPenalty()
    {
        return isset($this->frequency_penalty);
    }

    public function clearFrequencyPenalty()
    {
        unset($this->frequency_penalty);
    }

    /**
     * If specified, custom value for frequency penalty will be used.
     *
     * Generated from protobuf field <code>optional float frequency_penalty = 8;</code>
     * @param float $var
     * @return $this
     */
    public function setFrequencyPenalty($var)
    {
        GPBUtil::checkFloat($var);
        $this->frequency_penalty = $var;

        return $this;
    }

    /**
     * If specified, custom value for the seed will be used.
     *
     * Generated from protobuf field <code>optional int32 seed = 12;</code>
     * @return int
     */
    public function getSeed()
    {
        return isset($this->seed) ? $this->seed : 0;
    }

    public function hasSeed()
    {
        return isset($this->seed);
    }

    public function clearSeed()
    {
        unset($this->seed);
    }

    /**
     * If specified, custom value for the seed will be used.
     *
     * Generated from protobuf field <code>optional int32 seed = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setSeed($var)
    {
        GPBUtil::checkInt32($var);
        $this->seed = $var;

        return $this;
    }

    /**
     * If specified, custom value for presence penalty will be used.
     *
     * Generated from protobuf field <code>optional float presence_penalty = 9;</code>
     * @return float
     */
    public function getPresencePenalty()
    {
        return isset($this->presence_penalty) ? $this->presence_penalty : 0.0;
    }

    public function hasPresencePenalty()
    {
        return isset($this->presence_penalty);
    }

    public function clearPresencePenalty()
    {
        unset($this->presence_penalty);
    }

    /**
     * If specified, custom value for presence penalty will be used.
     *
     * Generated from protobuf field <code>optional float presence_penalty = 9;</code>
     * @param float $var
     * @return $this
     */
    public function setPresencePenalty($var)
    {
        GPBUtil::checkFloat($var);
        $this->presence_penalty = $var;

        return $this;
    }

    /**
     * If specified, custom value for max output tokens will be used.
     *
     * Generated from protobuf field <code>optional int32 max_output_tokens = 10;</code>
     * @return int
     */
    public function getMaxOutputTokens()
    {
        return isset($this->max_output_tokens) ? $this->max_output_tokens : 0;
    }

    public function hasMaxOutputTokens()
    {
        return isset($this->max_output_tokens);
    }

    public function clearMaxOutputTokens()
    {
        unset($this->max_output_tokens);
    }

    /**
     * If specified, custom value for max output tokens will be used.
     *
     * Generated from protobuf field <code>optional int32 max_output_tokens = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxOutputTokens($var)
    {
        GPBUtil::checkInt32($var);
        $this->max_output_tokens = $var;

        return $this;
    }

}


