MCPcopy Create free account
hub / github.com/anus-dev/ANUS / isValidContent

Function isValidContent

packages/core/src/core/anusChat.ts:42–55  ·  view source on GitHub ↗
(content: Content)

Source from the content-addressed store, hash-verified

40}
41
42function isValidContent(content: Content): boolean {
43 if (content.parts === undefined || content.parts.length === 0) {
44 return false;
45 }
46 for (const part of content.parts) {
47 if (part === undefined || Object.keys(part).length === 0) {
48 return false;
49 }
50 if (!part.thought && part.text !== undefined && part.text === '') {
51 return false;
52 }
53 }
54 return true;
55}
56
57/**
58 * Validates the history contains the correct roles.

Callers 2

isValidResponseFunction · 0.85
extractCuratedHistoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected