MCPcopy Create free account
hub / github.com/chieapp/chie / chatToJSON

Function chatToJSON

src/view/conversation-exporter.ts:33–41  ·  view source on GitHub ↗
(service: BaseChatService)

Source from the content-addressed store, hash-verified

31}
32
33function chatToJSON(service: BaseChatService) {
34 return JSON.stringify({
35 title: service.getTitle(),
36 conversation: service.history.map(m => ({
37 role: m.role.toString(),
38 content: m.content,
39 })),
40 }, null, 2);
41}
42
43function chatToText(service: BaseChatService) {
44 const separator = '\n\n-------------------\n\n';

Callers 1

runExportMenuFunction · 0.85

Calls 2

toStringMethod · 0.80
getTitleMethod · 0.45

Tested by

no test coverage detected