Spaces:
Sleeping
Sleeping
| import type { PromptExample } from '@/types/example'; | |
| /** | |
| * Get all unique sub-types from a collection of examples | |
| */ | |
| export function getUniqueSubTypes(examples: PromptExample[]): string[] { | |
| const subTypes = new Set<string>(); | |
| examples.forEach(example => { | |
| if (example.ει‘ε) { | |
| subTypes.add(example.ει‘ε); | |
| } | |
| }); | |
| return Array.from(subTypes); | |
| } | |
| /** | |
| * Filter examples by sub-type | |
| */ | |
| export function getExamplesBySubType(examples: PromptExample[], subType: string): PromptExample[] { | |
| return examples.filter(example => example.ει‘ε === subType); | |
| } | |