Record Class VertexAiGeminiSafetyRating
java.lang.Object
java.lang.Record
org.springframework.ai.vertexai.gemini.common.VertexAiGeminiSafetyRating
public record VertexAiGeminiSafetyRating(VertexAiGeminiSafetyRating.HarmCategory category, VertexAiGeminiSafetyRating.HarmProbability probability, boolean blocked, float probabilityScore, VertexAiGeminiSafetyRating.HarmSeverity severity, float severityScore)
extends Record
Represents a safety rating returned by the Vertex AI Gemini API for generated content.
Safety ratings indicate the probability and severity of harmful content in a specific
category.
- Since:
- 1.1.1
- Author:
- Mark Pollack
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum representing different categories of harmful content.static enumEnum representing the probability levels of harmful content.static enumEnum representing the severity levels of harmful content. -
Constructor Summary
ConstructorsConstructorDescriptionVertexAiGeminiSafetyRating(VertexAiGeminiSafetyRating.HarmCategory category, VertexAiGeminiSafetyRating.HarmProbability probability, boolean blocked, float probabilityScore, VertexAiGeminiSafetyRating.HarmSeverity severity, float severityScore) Creates an instance of aVertexAiGeminiSafetyRatingrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanblocked()Returns the value of theblockedrecord component.category()Returns the value of thecategoryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theprobabilityrecord component.floatReturns the value of theprobabilityScorerecord component.severity()Returns the value of theseverityrecord component.floatReturns the value of theseverityScorerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
VertexAiGeminiSafetyRating
public VertexAiGeminiSafetyRating(VertexAiGeminiSafetyRating.HarmCategory category, VertexAiGeminiSafetyRating.HarmProbability probability, boolean blocked, float probabilityScore, VertexAiGeminiSafetyRating.HarmSeverity severity, float severityScore) Creates an instance of aVertexAiGeminiSafetyRatingrecord class.- Parameters:
category- the value for thecategoryrecord componentprobability- the value for theprobabilityrecord componentblocked- the value for theblockedrecord componentprobabilityScore- the value for theprobabilityScorerecord componentseverity- the value for theseverityrecord componentseverityScore- the value for theseverityScorerecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
category
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
probability
Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-
blocked
public boolean blocked()Returns the value of theblockedrecord component.- Returns:
- the value of the
blockedrecord component
-
probabilityScore
public float probabilityScore()Returns the value of theprobabilityScorerecord component.- Returns:
- the value of the
probabilityScorerecord component
-
severity
Returns the value of theseverityrecord component.- Returns:
- the value of the
severityrecord component
-
severityScore
public float severityScore()Returns the value of theseverityScorerecord component.- Returns:
- the value of the
severityScorerecord component
-