_buildPrompt(content, existingTags = [], existingCorrespondent = []) {
        let systemPrompt;
        let promptTags = '';
    
        // Validate that existingCorrespondent is an array and handle if it's not
        const correspondentList = Array.isArray(existingCorrespondent) 
            ? existingCorrespondent 
            : [];
    
        if (process.env.USE_PROMPT_TAGS === 'yes') {
            promptTags = process.env.PROMPT_TAGS;
            systemPrompt = config.specialPromptPreDefinedTags;
        } else {
            systemPrompt = process.env.SYSTEM_PROMPT + '\n\n' + config.mustHavePrompt;
        }
    
        // Format existing tags
        const existingTagsList = Array.isArray(existingTags)
            ? existingTags
                .filter(tag => tag && tag.name)
                .map(tag => tag.name)
                .join(', ')
            : '';
    
        // Format existing correspondents - handle both array of objects and array of strings
        const existingCorrespondentList = correspondentList
            .filter(Boolean)  // Remove any null/undefined entries
            .map(correspondent => {
                if (typeof correspondent === 'string') return correspondent;
                return correspondent?.name || '';
            })
            .filter(name => name.length > 0)  // Remove empty strings
            .join(', ');
    
        if(process.env.USE_EXISTING_DATA === 'yes') {
            return `${systemPrompt}
            Existing tags: ${existingTagsList}\n
            Existing Correspondents: ${existingCorrespondentList}\n
            ${JSON.stringify(content)}
            
            `;
        } else {
            return `${systemPrompt}
            ${JSON.stringify(content)}
            `;
        }
    }
Build prompt from content and existing data
@param {string} content - Document content
@param {Array} existingTags - List of existing tags
@param {Array} existingCorrespondent - List of existing correspondents
@returns {string} Formatted prompt