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

Function getAutoToolSearchTokenThreshold

src/utils/toolSearch.ts:106–111  ·  view source on GitHub ↗

* Get the token threshold for auto-enabling tool search for a given model.

(model: string)

Source from the content-addressed store, hash-verified

104 * Get the token threshold for auto-enabling tool search for a given model.
105 */
106function getAutoToolSearchTokenThreshold(model: string): number {
107 const betas = getMergedBetas(model)
108 const contextWindow = getContextWindowForModel(model, betas)
109 const percentage = getAutoToolSearchPercentage() / 100
110 return Math.floor(contextWindow * percentage)
111}
112
113/**
114 * Get the character threshold for auto-enabling tool search for a given model.

Callers 2

checkAutoThresholdFunction · 0.85

Calls 3

getMergedBetasFunction · 0.85
getContextWindowForModelFunction · 0.85

Tested by

no test coverage detected