Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

334 B
Raw Blame
import type { RubricConfig } from '@lobechat/types';

import type { MatchResult } from './types';

export const matchRegex = (actual: string, config: RubricConfig): MatchResult => {
  const cfg = config as { pattern: string };
  const passed = new RegExp(cfg.pattern, 'i').test(actual);
  return { passed, score: passed ? 1 : 0 };
};