(history: ChatTurnMessage[])
| 1 | import { ChatTurnMessage } from '../types'; |
| 2 | |
| 3 | const formatChatHistoryAsString = (history: ChatTurnMessage[]) => { |
| 4 | return history |
| 5 | .map( |
| 6 | (message) => |
| 7 | `${message.role === 'assistant' ? 'AI' : 'User'}: ${message.content}`, |
| 8 | ) |
| 9 | .join('\n'); |
| 10 | }; |
| 11 | |
| 12 | export default formatChatHistoryAsString; |
no outgoing calls
no test coverage detected