MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / formatGeminiBlockMessage

Function formatGeminiBlockMessage

out/cli.cjs:79727–79737  ·  view source on GitHub ↗
(response)

Source from the content-addressed store, hash-verified

79725};
79726
79727// src/engine/gemini.ts
79728var GEMINI_BLOCKING_FINISH_REASONS = /* @__PURE__ */ new Set([
79729 FinishReason.RECITATION,
79730 FinishReason.SAFETY,
79731 FinishReason.LANGUAGE
79732]);
79733var formatGeminiBlockMessage = (response) => {
79734 const promptFeedback = response.promptFeedback;
79735 if (promptFeedback?.blockReason) {
79736 return promptFeedback.blockReasonMessage ? `Gemini response was blocked due to ${promptFeedback.blockReason}: ${promptFeedback.blockReasonMessage}` : `Gemini response was blocked due to ${promptFeedback.blockReason}`;
79737 }
79738 const firstCandidate = response.candidates?.[0];
79739 if (firstCandidate?.finishReason) {
79740 return firstCandidate.finishMessage ? `Gemini response was blocked due to ${firstCandidate.finishReason}: ${firstCandidate.finishMessage}` : `Gemini response was blocked due to ${firstCandidate.finishReason}`;

Callers 1

extractGeminiTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…