MCPcopy Create free account
hub / github.com/Tencent/teamai-cli / extractRecalledDocIdsFromValue

Function extractRecalledDocIdsFromValue

src/transcript-parser.ts:93–108  ·  view source on GitHub ↗
(value: unknown, out: Set<string>)

Source from the content-addressed store, hash-verified

91}
92
93function extractRecalledDocIdsFromValue(value: unknown, out: Set<string>): void {
94 if (typeof value === 'string') {
95 extractRecalledDocIdsFromComment(value, out);
96 extractRecalledDocIds(value, out);
97 return;
98 }
99 if (Array.isArray(value)) {
100 for (const item of value) extractRecalledDocIdsFromValue(item, out);
101 return;
102 }
103 if (value !== null && typeof value === 'object') {
104 for (const item of Object.values(value as Record<string, unknown>)) {
105 extractRecalledDocIdsFromValue(item, out);
106 }
107 }
108}
109
110function extractRecalledDocIds(text: string, out: Set<string>): void {
111 const START = '--- [teamai:recall:start] ---';

Callers 1

parseTranscriptForVotesFunction · 0.85

Calls 2

extractRecalledDocIdsFunction · 0.85

Tested by

no test coverage detected