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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Configuration for Speculative Decoding.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.SpeculativeDecodingSpec</code>
 */
class SpeculativeDecodingSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * The number of speculative tokens to generate at each step.
     *
     * Generated from protobuf field <code>int32 speculative_token_count = 1;</code>
     */
    protected $speculative_token_count = 0;
    protected $speculation;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\DraftModelSpeculation $draft_model_speculation
     *           draft model speculation.
     *     @type \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\NgramSpeculation $ngram_speculation
     *           N-Gram speculation.
     *     @type int $speculative_token_count
     *           The number of speculative tokens to generate at each step.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Endpoint::initOnce();
        parent::__construct($data);
    }

    /**
     * draft model speculation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation draft_model_speculation = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\DraftModelSpeculation|null
     */
    public function getDraftModelSpeculation()
    {
        return $this->readOneof(2);
    }

    public function hasDraftModelSpeculation()
    {
        return $this->hasOneof(2);
    }

    /**
     * draft model speculation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation draft_model_speculation = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\DraftModelSpeculation $var
     * @return $this
     */
    public function setDraftModelSpeculation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\DraftModelSpeculation::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * N-Gram speculation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation ngram_speculation = 3;</code>
     * @return \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\NgramSpeculation|null
     */
    public function getNgramSpeculation()
    {
        return $this->readOneof(3);
    }

    public function hasNgramSpeculation()
    {
        return $this->hasOneof(3);
    }

    /**
     * N-Gram speculation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation ngram_speculation = 3;</code>
     * @param \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\NgramSpeculation $var
     * @return $this
     */
    public function setNgramSpeculation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\SpeculativeDecodingSpec\NgramSpeculation::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * The number of speculative tokens to generate at each step.
     *
     * Generated from protobuf field <code>int32 speculative_token_count = 1;</code>
     * @return int
     */
    public function getSpeculativeTokenCount()
    {
        return $this->speculative_token_count;
    }

    /**
     * The number of speculative tokens to generate at each step.
     *
     * Generated from protobuf field <code>int32 speculative_token_count = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSpeculativeTokenCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->speculative_token_count = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSpeculation()
    {
        return $this->whichOneof("speculation");
    }

}

