-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from SkywardAI/function-improve
we have better account page now
- Loading branch information
Showing
8 changed files
with
123 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// export function formatMarkdown(input) { | ||
// input.split('\n').map(line=>{ | ||
|
||
// }) | ||
// } | ||
|
||
export function formatJSON(conversation, {createdAt, name}) { | ||
const json = | ||
`{ | ||
"session": { | ||
"id": "${conversation.id}", | ||
"createdAt": "${createdAt}", | ||
"title": "${name}", | ||
"history": [ | ||
${conversation.history.map(({type, message})=>{ | ||
return `{ "type": "${type}", "message": "${message.replaceAll('"', '\\"').replaceAll("\n", "\\n")}" }` | ||
}).join(`,\n${" ".repeat(12)}`)} | ||
] | ||
} | ||
}` | ||
const download_link = document.createElement('a') | ||
download_link.href=`data:text/plain;charset=utf-8,${json}` | ||
download_link.download = `session-${conversation.id}.json` | ||
download_link.click(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters