MCPcopy Create free account
hub / github.com/neomjs/neo / createQueryOptions

Method createQueryOptions

ai/services/knowledge-base/QueryService.mjs:269–282  ·  view source on GitHub ↗

* @summary Builds Chroma query option objects for a request. * * Broad `type='all'` searches are stratified before Chroma retrieval so historical * conversations cannot monopolize the candidate set before current source/docs reach * the hybrid scorer. * * @param {Object

({queryEmbeddingValues, requesterTenantId, type})

Source from the content-addressed store, hash-verified

267 * @returns {Object[]} Chroma query option objects.
268 */
269 createQueryOptions({queryEmbeddingValues, requesterTenantId, type}) {
270 if (type === 'all') {
271 return this.createBroadQueryOptions({queryEmbeddingValues, requesterTenantId});
272 }
273
274 return [
275 this.createQueryOption({
276 queryEmbeddingValues,
277 requesterTenantId,
278 typeFilter: this.resolveTypeFilter(type),
279 nResults : aiConfig.nResults
280 })
281 ];
282 }
283
284 /**
285 * @summary Builds source-tiered Chroma queries for broad KB searches.

Callers 1

queryDocumentsMethod · 0.95

Calls 3

createQueryOptionMethod · 0.95
resolveTypeFilterMethod · 0.95

Tested by

no test coverage detected