Fix macro not replacing in custom prompt

This commit is contained in:
Cohee
2024-09-05 10:23:51 +03:00
parent d62f18b523
commit b4ecba2a45

View File

@ -1161,7 +1161,7 @@ export async function getExpressionLabel(text, expressionsApi = extension_settin
} }
const expressionsList = await getExpressionsList(); const expressionsList = await getExpressionsList();
const prompt = customPrompt || await getLlmPrompt(expressionsList); const prompt = substituteParamsExtended(String(customPrompt), { labels: expressionsList }) || await getLlmPrompt(expressionsList);
let functionResult = null; let functionResult = null;
eventSource.once(event_types.TEXT_COMPLETION_SETTINGS_READY, onTextGenSettingsReady); eventSource.once(event_types.TEXT_COMPLETION_SETTINGS_READY, onTextGenSettingsReady);
eventSource.once(event_types.LLM_FUNCTION_TOOL_REGISTER, onFunctionToolRegister); eventSource.once(event_types.LLM_FUNCTION_TOOL_REGISTER, onFunctionToolRegister);