import{logger as e}from"../../../logger/index.mjs";import{extractJson as t,generateText as n}from"@intlayer/ai";import{readFileSync as r}from"node:fs";import{dirname as i,join as a}from"node:path";import{fileURLToPath as o}from"node:url";const s=r(a(i(o(import.meta.url)),`./PROMPT.md`),`utf-8`),c={},l=async({dictionaries:r,tag:i,aiConfig:a,applicationContext:o})=>{let c=s.replace(`{{tag.description}}`,i.description??``).replace(`{{tag.key}}`,i.key).replace(`{{applicationContext}}`,o??``),{text:l,usage:u}=await n({...a,messages:[{role:`system`,content:c},{role:`user`,content:[`**Tag to audit:**`,`This is the tag that you should consider to audit:`,JSON.stringify(i)].join(`
`)}]});return e.info(`${u?.totalTokens??0} tokens used in the request`),{fileContent:t(l),tokenUsed:u?.totalTokens??0}};export{c as aiDefaultOptions,l as auditTag};
//# sourceMappingURL=index.mjs.map