perplexica-auth / src /lib /utils /formatHistory.ts
pjpjq's picture
Deploy Perplexica to Hugging Face with nginx basic auth
6b6ca97 verified
import { ChatTurnMessage } from '../types';
const formatChatHistoryAsString = (history: ChatTurnMessage[]) => {
return history
.map(
(message) =>
`${message.role === 'assistant' ? 'AI' : 'User'}: ${message.content}`,
)
.join('\n');
};
export default formatChatHistoryAsString;