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

namespace Google\Cloud\DiscoveryEngine\V1beta;

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

/**
 * Response message for the
 * [GroundedGenerationService.CheckGrounding][google.cloud.discoveryengine.v1beta.GroundedGenerationService.CheckGrounding]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.CheckGroundingResponse</code>
 */
class CheckGroundingResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The support score for the input answer candidate.
     * Higher the score, higher is the fraction of claims that are supported by
     * the provided facts. This is always set when a response is returned.
     *
     * Generated from protobuf field <code>optional float support_score = 1;</code>
     */
    protected $support_score = null;
    /**
     * List of facts cited across all claims in the answer candidate.
     * These are derived from the facts supplied in the request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.FactChunk cited_chunks = 3;</code>
     */
    private $cited_chunks;
    /**
     * Claim texts and citation info across all claims in the answer candidate.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim claims = 4;</code>
     */
    private $claims;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $support_score
     *           The support score for the input answer candidate.
     *           Higher the score, higher is the fraction of claims that are supported by
     *           the provided facts. This is always set when a response is returned.
     *     @type array<\Google\Cloud\DiscoveryEngine\V1beta\FactChunk>|\Google\Protobuf\Internal\RepeatedField $cited_chunks
     *           List of facts cited across all claims in the answer candidate.
     *           These are derived from the facts supplied in the request.
     *     @type array<\Google\Cloud\DiscoveryEngine\V1beta\CheckGroundingResponse\Claim>|\Google\Protobuf\Internal\RepeatedField $claims
     *           Claim texts and citation info across all claims in the answer candidate.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\GroundedGenerationService::initOnce();
        parent::__construct($data);
    }

    /**
     * The support score for the input answer candidate.
     * Higher the score, higher is the fraction of claims that are supported by
     * the provided facts. This is always set when a response is returned.
     *
     * Generated from protobuf field <code>optional float support_score = 1;</code>
     * @return float
     */
    public function getSupportScore()
    {
        return isset($this->support_score) ? $this->support_score : 0.0;
    }

    public function hasSupportScore()
    {
        return isset($this->support_score);
    }

    public function clearSupportScore()
    {
        unset($this->support_score);
    }

    /**
     * The support score for the input answer candidate.
     * Higher the score, higher is the fraction of claims that are supported by
     * the provided facts. This is always set when a response is returned.
     *
     * Generated from protobuf field <code>optional float support_score = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setSupportScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->support_score = $var;

        return $this;
    }

    /**
     * List of facts cited across all claims in the answer candidate.
     * These are derived from the facts supplied in the request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.FactChunk cited_chunks = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCitedChunks()
    {
        return $this->cited_chunks;
    }

    /**
     * List of facts cited across all claims in the answer candidate.
     * These are derived from the facts supplied in the request.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.FactChunk cited_chunks = 3;</code>
     * @param array<\Google\Cloud\DiscoveryEngine\V1beta\FactChunk>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCitedChunks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\FactChunk::class);
        $this->cited_chunks = $arr;

        return $this;
    }

    /**
     * Claim texts and citation info across all claims in the answer candidate.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim claims = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getClaims()
    {
        return $this->claims;
    }

    /**
     * Claim texts and citation info across all claims in the answer candidate.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1beta.CheckGroundingResponse.Claim claims = 4;</code>
     * @param array<\Google\Cloud\DiscoveryEngine\V1beta\CheckGroundingResponse\Claim>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setClaims($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1beta\CheckGroundingResponse\Claim::class);
        $this->claims = $arr;

        return $this;
    }

}

