MCPcopy Create free account
hub / github.com/Noumena-Network/code / initFingerprint

Function initFingerprint

src/services/api/dumpPrompts.ts:78–92  ·  view source on GitHub ↗
(req: Record<string, unknown>)

Source from the content-addressed store, hash-verified

76}
77
78function initFingerprint(req: Record<string, unknown>): string {
79 const tools = req.tools as Array<{ name?: string }> | undefined
80 const system = req.system as unknown[] | string | undefined
81 const sysLen =
82 typeof system === 'string'
83 ? system.length
84 : Array.isArray(system)
85 ? system.reduce(
86 (n: number, b) => n + ((b as { text?: string }).text?.length ?? 0),
87 0,
88 )
89 : 0
90 const toolNames = tools?.map(t => t.name ?? '').join(',') ?? ''
91 return `${req.model}|${toolNames}|${sysLen}`
92}
93
94function dumpRequest(
95 body: string,

Callers 1

dumpRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected