MCPcopy Create free account
hub / github.com/ChatGPTBox-dev/chatGPTBox / initSession

Function initSession

src/services/init-session.mjs:47–108  ·  view source on GitHub ↗
({
  question = null,
  conversationRecords = [],
  sessionName = null,
  modelName = null,
  autoClean = false,
  apiMode = null,
  extraCustomModelName = '',
} = {})

Source from the content-addressed store, hash-verified

45 * @returns {Session}
46 */
47export function initSession({
48 question = null,
49 conversationRecords = [],
50 sessionName = null,
51 modelName = null,
52 autoClean = false,
53 apiMode = null,
54 extraCustomModelName = '',
55} = {}) {
56 return {
57 // common
58 question,
59 conversationRecords,
60
61 sessionName,
62 sessionId: uuidv4(),
63 createdAt: new Date().toISOString(),
64 updatedAt: new Date().toISOString(),
65
66 aiName:
67 modelName || apiMode
68 ? modelNameToDesc(
69 apiMode ? apiModeToModelName(apiMode) : modelName,
70 t,
71 extraCustomModelName,
72 )
73 : null,
74 modelName,
75 apiMode: normalizeApiMode(apiMode),
76
77 autoClean,
78 isRetry: false,
79
80 // chatgpt-web
81 conversationId: null,
82 messageId: null,
83 parentMessageId: null,
84 wsRequestId: null,
85
86 // bing
87 bingWeb_encryptedConversationSignature: null,
88 bingWeb_conversationId: null,
89 bingWeb_clientId: null,
90 bingWeb_invocationId: null,
91
92 // bing sydney
93 bingWeb_jailbreakConversationId: null,
94 bingWeb_parentMessageId: null,
95 bingWeb_jailbreakConversationCache: null,
96
97 // poe
98 poe_chatId: null,
99
100 // bard
101 bard_conversationObj: null,
102
103 // claude.ai
104 claude_conversation: null,

Callers 7

mountComponentFunction · 0.90
createSelectionToolsFunction · 0.90
prepareForRightClickMenuFunction · 0.90
ConversationCardFunction · 0.90
initDefaultSessionFunction · 0.90

Calls 3

modelNameToDescFunction · 0.90
apiModeToModelNameFunction · 0.90
normalizeApiModeFunction · 0.90

Tested by

no test coverage detected