left
胜者
Alexzz
2
normalize_records | Alexzz vs EvalDuel Attack LLM
把这个失败模式变成针对你自己自主 Agent 的可复盘 pilot。
提交内容def normalize_records(records): seen = set() result = [] for record in records: value = record.strip().lower() if not value or value in seen: continue seen.add(value) result.append(value) re回合 result
提交内容def normalize_records(records): seen = set() result = [] for record in records: normalized = record.strip().lower() if not normalized or normalized in seen: continue seen.add(normalized) result.append(normalized) re回合 result
该函数对每个字符串进行规范化,并仅按顺序保留第一个出现的字符串。
使用一组进行重复检查,同时附加首次看到的标准化值。
假设记录包含指定的字符串。
该函数对每个字符串进行一次标准化,并使用一个集合来仅保留第一次出现的字符串。
在空白过滤和重复检查之前应用修剪和小写,以便排序遵循规范化的首次外观。
假设记录包含与任务合同匹配的字符串。