Debian Codegraph @

lualib/plugins/neural/providers/symbols.lua

raw
1 -- Symbols provider: wraps legacy symbols+metatokens vectorization
2
3 local neural_common = require "plugins/neural"
4
5 neural_common.register_provider('symbols', {
6 collect = function(task, ctx)
7 local vec = neural_common.result_to_vector(task, ctx.profile)
8 return vec, { name = 'symbols', type = 'symbols', dim = #vec, weight = ctx.weight or 1.0 }
9 end,
10 collect_async = function(task, ctx, cont)
11 local vec = neural_common.result_to_vector(task, ctx.profile)
12 cont(vec, { name = 'symbols', type = 'symbols', dim = #vec, weight = ctx.weight or 1.0 })
13 end
14 })