import{formatResponse as e}from"../utils/responseData.mjs";import{searchChunkReference as t}from"../utils/AI/askDocQuestion/askDocQuestion.mjs";const n=async(n,r)=>{let{input:i,limit:a,returnContent:o}=n.query,s=a?Number.parseInt(a,10):30,c=o===`true`,l=await t(i,s,.2);if(c){let t=e({data:l.map(e=>({fileKey:e.fileKey,chunkNumber:e.chunkNumber,content:e.content,docUrl:e.docUrl,docName:e.docName}))});return r.send(t)}let u=l.map(e=>e.fileKey),d=e({data:Array.from(new Set(u))});return r.send(d)};export{n as searchDocUtil};
//# sourceMappingURL=search.controller.mjs.map