MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / cleanMessageContent

Method cleanMessageContent

src/api/providers/vscode-lm.ts:341–363  ·  view source on GitHub ↗
(content: any)

Source from the content-addressed store, hash-verified

339 }
340
341 private cleanMessageContent(content: any): any {
342 if (!content) {
343 return content
344 }
345
346 if (typeof content === "string") {
347 return content
348 }
349
350 if (Array.isArray(content)) {
351 return content.map((item) => this.cleanMessageContent(item))
352 }
353
354 if (typeof content === "object") {
355 const cleaned: any = {}
356 for (const [key, value] of Object.entries(content)) {
357 cleaned[key] = this.cleanMessageContent(value)
358 }
359 return cleaned
360 }
361
362 return content
363 }
364
365 override async *createMessage(
366 systemPrompt: string,

Callers 1

createMessageMethod · 0.95

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected