refactoring and clean up
This commit is contained in:
13
packages/shared/src/utils.js
Normal file
13
packages/shared/src/utils.js
Normal file
@@ -0,0 +1,13 @@
|
||||
function parseRow(row) {
|
||||
if (!row) return null;
|
||||
return {
|
||||
...row,
|
||||
metadata: row.metadata ? JSON.parse(row.metadata) : null
|
||||
};
|
||||
}
|
||||
|
||||
function formatEpisodeText(userMessage, aiResponse) {
|
||||
return `User: ${userMessage}\nAssistant: ${aiResponse}`;
|
||||
}
|
||||
|
||||
module.exports = { parseRow, formatEpisodeText };
|
||||
Reference in New Issue
Block a user