MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / loadPrompts

Function loadPrompts

lib/ai.js:21–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21async function loadPrompts() {
22 const prompts = {}
23 const promptNames = ['writeStep', 'healStep', 'generatePageObject']
24
25 for (const name of promptNames) {
26 let promptPath
27
28 if (store.codeceptDir) {
29 promptPath = path.join(store.codeceptDir, `prompts/${name}.js`)
30 }
31
32 if (!promptPath || !fileExists(promptPath)) {
33 promptPath = path.join(__dirname, `template/prompts/${name}.js`)
34 }
35
36 try {
37 const resolvedPath = resolveImportModulePath(promptPath)
38 const module = await import(resolvedPath)
39 prompts[name] = module.default || module
40 debug(`Loaded prompt ${name} from ${promptPath}`)
41 } catch (err) {
42 debug(`Failed to load prompt ${name}:`, err.message)
43 }
44 }
45
46 return prompts
47}
48
49class AiAssistant {
50 constructor() {

Callers 1

enableMethod · 0.85

Calls 3

fileExistsFunction · 0.90
resolveImportModulePathFunction · 0.90
debugFunction · 0.85

Tested by

no test coverage detected