NAME

Google::Ai::Generativelanguage::V1beta::Safety - Compiled Protocol Buffers messages for google/ai/generativelanguage/v1beta/safety.proto

SYNOPSIS

use Google::Ai::Generativelanguage::V1beta::Safety;

my $msg = Google::Ai::Generativelanguage::V1beta::Safety::ContentFilter->new({
    reason => $reason,
    message => $message,
});

# Read or update a field
my $val = $msg->reason();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Ai::Generativelanguage::V1beta::Safety::ContentFilter->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/ai/generativelanguage/v1beta/safety.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Ai::Generativelanguage::V1beta::Safety::ContentFilter

Content filtering metadata associated with processing a single request.

ContentFilter contains a reason and an optional supporting string. The reason may be unspecified.

Inherits from Protobuf::Message.

Accessors

Enum: ContentFilter::BlockedReason

  • BLOCKED_REASON_UNSPECIFIED => 0

  • SAFETY => 1

  • OTHER => 2

Google::Ai::Generativelanguage::V1beta::Safety::SafetyFeedback

Safety feedback for an entire request.

This field is populated if content in the input and/or response is blocked due to safety settings. SafetyFeedback may not exist for every HarmCategory. Each SafetyFeedback will return the safety settings used by the request as well as the lowest HarmProbability that should be allowed in order to return a result.

Inherits from Protobuf::Message.

Accessors

Google::Ai::Generativelanguage::V1beta::Safety::SafetyRating

Safety rating for a piece of content.

The safety rating contains the category of harm and the harm probability level in that category for a piece of content. Content is classified for safety across a number of harm categories and the probability of the harm classification is included here.

Inherits from Protobuf::Message.

Accessors

Enum: SafetyRating::HarmProbability

  • HARM_PROBABILITY_UNSPECIFIED => 0

  • NEGLIGIBLE => 1

  • LOW => 2

  • MEDIUM => 3

  • HIGH => 4

Google::Ai::Generativelanguage::V1beta::Safety::SafetySetting

Safety setting, affecting the safety-blocking behavior.

Passing a safety setting for a category changes the allowed probability that content is blocked.

Inherits from Protobuf::Message.

Accessors

Enum: SafetySetting::HarmBlockThreshold

  • HARM_BLOCK_THRESHOLD_UNSPECIFIED => 0

  • BLOCK_LOW_AND_ABOVE => 1

  • BLOCK_MEDIUM_AND_ABOVE => 2

  • BLOCK_ONLY_HIGH => 3

  • BLOCK_NONE => 4

  • OFF => 5

SEE ALSO

Protobuf, Protobuf::Message, Google::Ai::Generativelanguage::V1beta::Safety::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.