const speaker_bio_lookup = require('./speaker_bio_lookup'); const speaker_meet_and_greet = require('./speaker_meet_and_greet'); const speaker_contact_info = require('./speaker_contact_info'); const { CALL2_SPEAKER_MAIN_PROMPT } = require('./main'); const { CALL2_CONVERSATION_PROMPT } = require('../conversation'); const MODULES = [speaker_bio_lookup, speaker_meet_and_greet, speaker_contact_info]; const PROMPTLETS = Object.fromEntries(MODULES.map((m) => [m.intent, m.promptlet])); const SPEAKER_CARD_INTENTS = new Set(MODULES.filter((m) => m.usesSpeakerCards).map((m) => m.intent)); const SESSION_CARD_INTENTS = new Set(MODULES.filter((m) => m.usesSessionCards).map((m) => m.intent)); function buildSpeakerCall2SystemPrompt(intent) { const promptlet = PROMPTLETS[intent]; if (!promptlet) return null; return `${CALL2_CONVERSATION_PROMPT}\n\n${CALL2_SPEAKER_MAIN_PROMPT}\n\n${promptlet}`; } function usesSpeakerCards(intent) { return SPEAKER_CARD_INTENTS.has(String(intent || '')); } function usesSpeakerSessionCards(intent) { return SESSION_CARD_INTENTS.has(String(intent || '')); } module.exports = { PROMPTLETS, buildSpeakerCall2SystemPrompt, usesSpeakerCards, usesSpeakerSessionCards, };