Class GoogleGenAiDecisionResponseMetadata
java.lang.Object
dev.langchain4j.model.decision.response.DecisionResponseMetadata
dev.langchain4j.model.google.genai.GoogleGenAiDecisionResponseMetadata
The metadata of a
DecisionResponse of a GoogleGenAiDecisionModel. In addition to the model name and
the token usage, it reports why Gemini blocked the input, if it did. When the input is blocked, the answer to every
question is a RefusalAnswer.
DecisionResponse response = decisionModel.decide(request);
GoogleGenAiDecisionResponseMetadata metadata = (GoogleGenAiDecisionResponseMetadata) response.metadata();
String blockReason = metadata.blockReason(); // for example "safety", or null when the input was not blocked
- Since:
- 1.24.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@Nullable StringGemini's explanation of why it blocked the input, ornullwhen the input was not blocked or Gemini gave no explanation.@Nullable StringWhy Gemini blocked the input, as reported by Gemini, for example"safety"or"prohibited_content", ornullwhen the input was not blocked.builder()booleaninthashCode()toString()Methods inherited from class DecisionResponseMetadata
modelName, tokenUsage
-
Method Details
-
blockReason
Why Gemini blocked the input, as reported by Gemini, for example"safety"or"prohibited_content", ornullwhen the input was not blocked. -
blockMessage
Gemini's explanation of why it blocked the input, ornullwhen the input was not blocked or Gemini gave no explanation. -
equals
- Overrides:
equalsin classDecisionResponseMetadata
-
hashCode
public int hashCode()- Overrides:
hashCodein classDecisionResponseMetadata
-
toString
- Overrides:
toStringin classDecisionResponseMetadata
-
builder
-