@cognigy/rest-api-client
Version:
Cognigy REST-Client
37 lines • 2.32 kB
JavaScript
const lexiconGenerationPromptString = 'For the NLU model lexicon with the title "@@name" and the description "@@description",' +
' generate @ varied words in "@@lng".@' +
'\n\nRespond with a valid JSON with the format following the example: `@`';
export const 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 @ varied words in "@@lng".@' +
'\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: @';
export const 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.",
}
];
export const 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.";
export const LEXICON_GENERATION_RESPONSE_EXAMPLE = '[{"word": "test","synonyms": ["trial","attempt"]},{"word": "demo","synonyms": ["proof of concept"]}]';
export const LEXICON_GENERATION_RESPONSE_EXAMPLE_NO_SYNONYMS = '[{"word": "test"},{"word": "demo"}]';
//# sourceMappingURL=lexiconGeneration.js.map