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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Specifies the context retrieval config.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.RagRetrievalConfig</code>
 */
class RagRetrievalConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The number of contexts to retrieve.
     *
     * Generated from protobuf field <code>int32 top_k = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $top_k = 0;
    /**
     * Optional. Config for filters.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter filter = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $filter = null;
    /**
     * Optional. Config for ranking and reranking.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking ranking = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $ranking = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $top_k
     *           Optional. The number of contexts to retrieve.
     *     @type \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Filter $filter
     *           Optional. Config for filters.
     *     @type \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking $ranking
     *           Optional. Config for ranking and reranking.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The number of contexts to retrieve.
     *
     * Generated from protobuf field <code>int32 top_k = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getTopK()
    {
        return $this->top_k;
    }

    /**
     * Optional. The number of contexts to retrieve.
     *
     * Generated from protobuf field <code>int32 top_k = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setTopK($var)
    {
        GPBUtil::checkInt32($var);
        $this->top_k = $var;

        return $this;
    }

    /**
     * Optional. Config for filters.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter filter = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Filter|null
     */
    public function getFilter()
    {
        return $this->filter;
    }

    public function hasFilter()
    {
        return isset($this->filter);
    }

    public function clearFilter()
    {
        unset($this->filter);
    }

    /**
     * Optional. Config for filters.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter filter = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Filter $var
     * @return $this
     */
    public function setFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Filter::class);
        $this->filter = $var;

        return $this;
    }

    /**
     * Optional. Config for ranking and reranking.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking ranking = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking|null
     */
    public function getRanking()
    {
        return $this->ranking;
    }

    public function hasRanking()
    {
        return isset($this->ranking);
    }

    public function clearRanking()
    {
        unset($this->ranking);
    }

    /**
     * Optional. Config for ranking and reranking.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig.Ranking ranking = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking $var
     * @return $this
     */
    public function setRanking($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagRetrievalConfig\Ranking::class);
        $this->ranking = $var;

        return $this;
    }

}

