MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / createMessage

Function createMessage

app/store/chat.ts:68–76  ·  view source on GitHub ↗
(override: Partial<ChatMessage>)

Source from the content-addressed store, hash-verified

66};
67
68export function createMessage(override: Partial<ChatMessage>): ChatMessage {
69 return {
70 id: nanoid(),
71 date: new Date().toLocaleString(),
72 role: "user",
73 content: "",
74 ...override,
75 };
76}
77
78export interface ChatStat {
79 tokenCount: number;

Callers 8

ContextPromptsFunction · 0.90
_ChatFunction · 0.90
handleResponseFunction · 0.90
handleInputAudioFunction · 0.90
chat.tsFile · 0.85
onUserInputFunction · 0.85
getMessagesWithMemoryFunction · 0.85
summarizeSessionFunction · 0.85

Calls 1

nanoidFunction · 0.85

Tested by

no test coverage detected