Remove chat rate limit
This commit is contained in:
@@ -19,6 +19,32 @@ import {
|
||||
import { cn } from "./lib/utils";
|
||||
import { citationSectionLabel } from "./CitationCard";
|
||||
|
||||
// Display-only patch, 2026-08-13: exactly 3 of 684 catalog entries have "Đ"/
|
||||
// "đ" in their canonical name (ingestion's slug generator maps every other
|
||||
// Vietnamese diacritic to its base Latin letter, but drops "Đ"/"đ" entirely
|
||||
// instead of mapping it to "D"/"d" — it is not a combining-mark decomposition
|
||||
// under Unicode NFKD, so a generic accent-strip silently loses it). Fixing
|
||||
// the underlying drug_id would mean re-keying every citation chunk_id built
|
||||
// from it in the already-loaded Qdrant corpus, so this only corrects the
|
||||
// header label shown to the user, not the data. Verified against the full
|
||||
// catalog (`ingestion/data/verified/drug_entities.json`): these are the only
|
||||
// 3 affected ids.
|
||||
const DRUG_ID_DISPLAY_OVERRIDES: Record<string, string> = {
|
||||
giai_oc_to_uon_van_hap_phu_vac_xin_uon_van_hap_phu:
|
||||
"GIẢI ĐỘC TỐ UỐN VÁN HẤP PHỤ (VẮC XIN UỐN VÁN HẤP PHỤ)",
|
||||
khang_oc_to_bach_hau: "KHÁNG ĐỘC TỐ BẠCH HẦU",
|
||||
thuoc_uong_bu_nuoc_va_ien_giai: "THUỐC UỐNG BÙ NƯỚC VÀ ĐIỆN GIẢI",
|
||||
};
|
||||
|
||||
function formatResolvedDrugId(resolvedDrugId: string): string {
|
||||
return resolvedDrugId
|
||||
.split(",")
|
||||
.map((id) => id.trim())
|
||||
.filter(Boolean)
|
||||
.map((id) => DRUG_ID_DISPLAY_OVERRIDES[id] ?? id.replace(/_/g, " ").toUpperCase())
|
||||
.join(", ");
|
||||
}
|
||||
|
||||
interface ChatBubbleProps {
|
||||
message: ChatMessage;
|
||||
// `allCitations` is THIS message's own citation list (`message.citations`)
|
||||
@@ -256,7 +282,7 @@ export function ChatBubble({
|
||||
<BookOpen className="h-3.5 w-3.5" />
|
||||
</div>
|
||||
<span className="text-xs font-semibold text-txt-secondary">
|
||||
{message.resolvedDrugId ? message.resolvedDrugId.replace(/_/g, " ").toUpperCase() : "Trợ lý Dược thư"}
|
||||
{message.resolvedDrugId ? formatResolvedDrugId(message.resolvedDrugId) : "Trợ lý Dược thư"}
|
||||
</span>
|
||||
{message.decision === "answerable" && message.grounded !== false && (
|
||||
<span className="inline-flex items-center gap-1 text-[0.68rem] font-medium text-status-success">
|
||||
|
||||
Reference in New Issue
Block a user