Class GoogleGenAiDecisionResponseMetadata

java.lang.Object
dev.langchain4j.model.decision.response.DecisionResponseMetadata
dev.langchain4j.model.google.genai.GoogleGenAiDecisionResponseMetadata

@Experimental public class GoogleGenAiDecisionResponseMetadata extends DecisionResponseMetadata
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