MCPcopy Create free account
hub / github.com/contextgo/contextgo / makeChunk

Function makeChunk

tests/unit/context-engine/contextEngineService.test.ts:60–72  ·  view source on GitHub ↗
(overrides: Partial<ChunkRecord> & Pick<ChunkRecord, 'id' | 'documentId' | 'text'>)

Source from the content-addressed store, hash-verified

58}
59
60function makeChunk(overrides: Partial<ChunkRecord> & Pick<ChunkRecord, 'id' | 'documentId' | 'text'>): ChunkRecord {
61 return {
62 id: overrides.id,
63 spaceId: SPACE_ID,
64 documentId: overrides.documentId,
65 sequence: overrides.sequence ?? 0,
66 text: overrides.text,
67 tokenCount: overrides.tokenCount ?? 20,
68 contentHash: overrides.contentHash ?? `${overrides.id}-hash`,
69 tier: overrides.tier ?? 'source',
70 embeddingKey: overrides.embeddingKey,
71 };
72}
73
74function makeProfile(overrides: Partial<ProfileSegment> & Pick<ProfileSegment, 'id' | 'summary'>): ProfileSegment {
75 return {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected