MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / clearContext

Method clearContext

deepwiki/deepwiki.ts:321–334  ·  view source on GitHub ↗
(chatKey: string, tag?: string)

Source from the content-addressed store, hash-verified

319 }
320
321 async clearContext(chatKey: string, tag?: string): Promise<void> {
322 this.ensureReady();
323 const ctx = await this.ensureCtxChat(chatKey);
324 ctx.contextTurns ||= {};
325 if (tag) {
326 delete ctx.contextTurns[tag];
327 } else {
328 ctx.contextTurns = {};
329 }
330
331 const key = this.gk(chatKey);
332 this.dbCtx.data!.chats[key] = ctx;
333 await this.dbCtx.write();
334 }
335
336 async appendTurn(chatKey: string, tag: string, q: string, a: string): Promise<void> {
337 this.ensureReady();

Callers 1

DeepWikiPluginClass · 0.80

Calls 4

ensureReadyMethod · 0.95
ensureCtxChatMethod · 0.95
gkMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected