<?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;

/**
 * Retrieve from Vertex RAG Store for grounding.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.VertexRagStore</code>
 */
class VertexRagStore extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The representation of the rag source. It can be used to specify
     * corpus only or ragfiles. Currently only support one corpus or multiple
     * files from one corpus. In the future we may open up multiple corpora
     * support.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.VertexRagStore.RagResource rag_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $rag_resources;
    /**
     * Optional. Number of top k results to return from the selected corpora.
     *
     * Generated from protobuf field <code>optional int32 similarity_top_k = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @deprecated
     */
    protected $similarity_top_k = null;
    /**
     * Optional. Only return results with vector distance smaller than the
     * threshold.
     *
     * Generated from protobuf field <code>optional double vector_distance_threshold = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @deprecated
     */
    protected $vector_distance_threshold = null;
    /**
     * Optional. The retrieval config for the Rag query.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig rag_retrieval_config = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $rag_retrieval_config = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\AIPlatform\V1\VertexRagStore\RagResource>|\Google\Protobuf\Internal\RepeatedField $rag_resources
     *           Optional. The representation of the rag source. It can be used to specify
     *           corpus only or ragfiles. Currently only support one corpus or multiple
     *           files from one corpus. In the future we may open up multiple corpora
     *           support.
     *     @type int $similarity_top_k
     *           Optional. Number of top k results to return from the selected corpora.
     *     @type float $vector_distance_threshold
     *           Optional. Only return results with vector distance smaller than the
     *           threshold.
     *     @type \Google\Cloud\AIPlatform\V1\RagRetrievalConfig $rag_retrieval_config
     *           Optional. The retrieval config for the Rag query.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The representation of the rag source. It can be used to specify
     * corpus only or ragfiles. Currently only support one corpus or multiple
     * files from one corpus. In the future we may open up multiple corpora
     * support.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.VertexRagStore.RagResource rag_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRagResources()
    {
        return $this->rag_resources;
    }

    /**
     * Optional. The representation of the rag source. It can be used to specify
     * corpus only or ragfiles. Currently only support one corpus or multiple
     * files from one corpus. In the future we may open up multiple corpora
     * support.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.VertexRagStore.RagResource rag_resources = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\AIPlatform\V1\VertexRagStore\RagResource>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRagResources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\VertexRagStore\RagResource::class);
        $this->rag_resources = $arr;

        return $this;
    }

    /**
     * Optional. Number of top k results to return from the selected corpora.
     *
     * Generated from protobuf field <code>optional int32 similarity_top_k = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     * @deprecated
     */
    public function getSimilarityTopK()
    {
        if (isset($this->similarity_top_k)) {
            @trigger_error('similarity_top_k is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->similarity_top_k) ? $this->similarity_top_k : 0;
    }

    public function hasSimilarityTopK()
    {
        if (isset($this->similarity_top_k)) {
            @trigger_error('similarity_top_k is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->similarity_top_k);
    }

    public function clearSimilarityTopK()
    {
        @trigger_error('similarity_top_k is deprecated.', E_USER_DEPRECATED);
        unset($this->similarity_top_k);
    }

    /**
     * Optional. Number of top k results to return from the selected corpora.
     *
     * Generated from protobuf field <code>optional int32 similarity_top_k = 2 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     * @deprecated
     */
    public function setSimilarityTopK($var)
    {
        @trigger_error('similarity_top_k is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkInt32($var);
        $this->similarity_top_k = $var;

        return $this;
    }

    /**
     * Optional. Only return results with vector distance smaller than the
     * threshold.
     *
     * Generated from protobuf field <code>optional double vector_distance_threshold = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     * @deprecated
     */
    public function getVectorDistanceThreshold()
    {
        if (isset($this->vector_distance_threshold)) {
            @trigger_error('vector_distance_threshold is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->vector_distance_threshold) ? $this->vector_distance_threshold : 0.0;
    }

    public function hasVectorDistanceThreshold()
    {
        if (isset($this->vector_distance_threshold)) {
            @trigger_error('vector_distance_threshold is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->vector_distance_threshold);
    }

    public function clearVectorDistanceThreshold()
    {
        @trigger_error('vector_distance_threshold is deprecated.', E_USER_DEPRECATED);
        unset($this->vector_distance_threshold);
    }

    /**
     * Optional. Only return results with vector distance smaller than the
     * threshold.
     *
     * Generated from protobuf field <code>optional double vector_distance_threshold = 3 [deprecated = true, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     * @deprecated
     */
    public function setVectorDistanceThreshold($var)
    {
        @trigger_error('vector_distance_threshold is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkDouble($var);
        $this->vector_distance_threshold = $var;

        return $this;
    }

    /**
     * Optional. The retrieval config for the Rag query.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig rag_retrieval_config = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\RagRetrievalConfig|null
     */
    public function getRagRetrievalConfig()
    {
        return $this->rag_retrieval_config;
    }

    public function hasRagRetrievalConfig()
    {
        return isset($this->rag_retrieval_config);
    }

    public function clearRagRetrievalConfig()
    {
        unset($this->rag_retrieval_config);
    }

    /**
     * Optional. The retrieval config for the Rag query.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.RagRetrievalConfig rag_retrieval_config = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\RagRetrievalConfig $var
     * @return $this
     */
    public function setRagRetrievalConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\RagRetrievalConfig::class);
        $this->rag_retrieval_config = $var;

        return $this;
    }

}

