Skip to content

Commit 490c69e

Browse files
committed
refactor how prompts are constructed
1 parent e09efd7 commit 490c69e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/rce.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,11 @@ export async function RCEActionHandler(actionData: ActionData, actionList: Recor
295295
return;
296296
}
297297

298-
// literally why can't we use " 'x wants to' + typeof action.promptGenerator === 'string' "
299-
const prompt = typeof action.promptGenerator === 'string'
300-
? NEURO.currentController + ' wants to ' + (action.promptGenerator as string).trim()
301-
: NEURO.currentController + ' wants to ' + (action.promptGenerator as (actionData: ActionData) => string)(actionData).trim();
298+
const prompt = (NEURO.currentController
299+
? NEURO.currentController
300+
: 'The Neuro API server') +
301+
' wants to ' +
302+
(typeof action.promptGenerator === 'string' ? action.promptGenerator.trim() : action.promptGenerator(actionData).trim());
302303

303304
createRceRequest(
304305
prompt,

0 commit comments

Comments
 (0)