Portal/rsconcept/frontend/src/features/ai/labels.ts

29 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-07-13 17:58:32 +03:00
import { PromptVariableType } from './models/prompting';
const describePromptVariableRecord: Record<PromptVariableType, string> = {
[PromptVariableType.BLOCK]: 'Текущий блок операционной схемы',
[PromptVariableType.OSS]: 'Текущая операционная схема',
2025-07-15 21:59:38 +03:00
[PromptVariableType.SCHEMA]: 'Текущая концептуальная схема',
2025-07-13 17:58:32 +03:00
[PromptVariableType.CONSTITUENTA]: 'Текущая конституента'
};
2025-07-15 21:59:38 +03:00
const mockPromptVariableRecord: Record<PromptVariableType, string> = {
[PromptVariableType.BLOCK]: 'Пример: Текущий блок операционной схемы',
[PromptVariableType.OSS]: 'Пример: Текущая операционная схема',
[PromptVariableType.SCHEMA]: 'Пример: Текущая концептуальная схема',
[PromptVariableType.CONSTITUENTA]: 'Пример: Текущая конституента'
};
2025-07-13 17:58:32 +03:00
/** Retrieves description for {@link PromptVariableType}. */
export function describePromptVariable(itemType: PromptVariableType): string {
return describePromptVariableRecord[itemType] ?? `UNKNOWN VARIABLE TYPE: ${itemType}`;
}
2025-07-15 21:59:38 +03:00
/** Retrieves mock text for {@link PromptVariableType}. */
export function mockPromptVariable(variable: string): string {
if (!Object.values(PromptVariableType).includes(variable as PromptVariableType)) {
return variable;
}
return mockPromptVariableRecord[variable as PromptVariableType] ?? `UNKNOWN VARIABLE: ${variable}`;
}