@cognigy/rest-api-client
Version:
Cognigy REST-Client
40 lines • 2.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LEXICON_GENERATION_RESPONSE_EXAMPLE_NO_SYNONYMS = exports.LEXICON_GENERATION_RESPONSE_EXAMPLE = exports.LEXICON_GENERATION_PROMPT_SYNONYM_INSTRUCTIONS = exports.strictLexiconGenerationPrompt = exports.lexiconGenerationPrompt = void 0;
const lexiconGenerationPromptString = 'For the NLU model lexicon with the title "@@name" and the description "@@description",' +
' generate @@lexiconEntries varied words in "@@lng".@@synonymInstructions' +
'\n\nRespond with a valid JSON with the format following the example: `@@example`';
exports.lexiconGenerationPrompt = [
{
role: "system",
content: lexiconGenerationPromptString,
},
// The user role is a workaround for Anthropic models which require a user message as per our implementation in llm-providers.
// However, the user role confuses gpt-4.1, which needs a more descriptive user message to generate the lexicon entries.
{
role: "user",
content: "Let's start generating the lexicon entries."
}
];
const strictLexiconGenerationPromptString = 'For the NLU model lexicon with the title "@@name" and the description "@@description",' +
' generate @@lexiconEntries varied words in "@@lng".@@synonymInstructions' +
'\n\nYou MUST respond with ONLY a valid JSON array, nothing else.' +
' Do not include any explanations, comments, greetings, or markdown formatting.' +
' Do not wrap the JSON in code blocks. Your entire response must be parseable by JSON.parse().' +
'\n\nFollow this exact format: @@example';
exports.strictLexiconGenerationPrompt = [
{
role: "system",
content: strictLexiconGenerationPromptString,
},
// The user role is a workaround for Anthropic models which require a user message as per our implementation in llm-providers.
// However, the user role confuses gpt-4.1, which needs a more descriptive user message to generate the lexicon entries.
{
role: "user",
content: "Generate the lexicon entries now. Respond with only the JSON array, no other text.",
}
];
exports.LEXICON_GENERATION_PROMPT_SYNONYM_INSTRUCTIONS = " For each word, also list all known synonyms. The number of synonyms for each word does not have to be the same.";
exports.LEXICON_GENERATION_RESPONSE_EXAMPLE = '[{"word": "test","synonyms": ["trial","attempt"]},{"word": "demo","synonyms": ["proof of concept"]}]';
exports.LEXICON_GENERATION_RESPONSE_EXAMPLE_NO_SYNONYMS = '[{"word": "test"},{"word": "demo"}]';
//# sourceMappingURL=lexiconGeneration.js.map