INNER CODE UNIT · TypeScript

answerInThread

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

export async function answerInThread(
  thread: PostableThread,
  question: string,
  surface: ReplySurface,
  author?: unknown,
  isThreaded: boolean = true,
  attachments?: ImageAttachment[],
): Promise<void> {
  const platform = extractPlatform(thread.id);
  const startedAt = Date.now();
  const userId = (author as { userId?: string } | undefined)?.userId || "unknown";
  const channelId = extractChannelId(thread.id);
  const threadId = extractThreadId(thread.id);
  try {
    // Show a typing/thinking indicator while the backend streams so a
    // multi-second answer doesn't feel unresponsive. Feature-detected and
    // fire-and-forget — a no-op on adapters that don't support it, and posting
    // the reply clears it. Never let a failing indicator break the reply.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…