enrichToken({ token, citations = [] }) {
    if (!Array.isArray(citations) || citations.length === 0) return token;
    return token.replace(/\[(\d+)\]/g, (match, index) => {
      const citationIndex = parseInt(index) - 1;
      return citations[citationIndex]
        ? `[[${index}](${citations[citationIndex]})]`
        : match;
    });
  }
Generic formatting of a token for the following use cases:
- Perplexity models that return inline citations in the token text
@param {{token: string, citations: string[]}} options - The token text and citations.
@returns {string} - The formatted token text.