INNER CODE UNIT · TypeScript

isImageAttachment

Beever-AI/beever-atlas · bot/src/index.ts:421

export function isImageAttachment(att: IncomingAttachment): boolean {
  if (att.type === "image") return true;
  return typeof att.mimeType === "string" && att.mimeType.startsWith("image/");
}

/**
 * Pre-extraction mention gate. Runs the normal text intent gate, then applies
 * an ADDITIVE override: a mention that carries an image is answerable even when
 * its text alone would only prompt/skip (so "image + 'what is this?'" doesn't
 * hit the bare-mention greeting branch). Text-only gating is unchanged.
 */
export function decideMentionGate(input: {
  text: string;
  broadcast: boolean;
  hasImage: boolean;
}): RespondDecision {
  const decision = decideShouldRespond({
    text: input.text,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…