Fix ai-service Dockerfile: bake in drug_entities.json, override its path

This commit is contained in:
2026-08-10 10:35:13 +07:00
parent a4b8e1c4db
commit 60b4397032
51 changed files with 4302 additions and 2087 deletions
+28 -2
View File
@@ -1,9 +1,26 @@
export interface Citation {
chunkId: string;
drugName: string;
sectionType: string;
/** Printed page numbers as they appear in the book — what a clinician reads off their paper copy. */
sourcePageRange: [number, number];
snippet?: string;
reason?: string;
/** PyMuPDF 0-indexed page of the physical PDF file — NOT the printed page. Add 1 for a `#page=` viewer fragment. */
physicalPage: number;
/** The exact chunk text retrieved and handed to the LLM/grounding check — not a paraphrase. */
snippet: string;
/** True when this chunk carries a table/formula the pipeline quarantined (never linearised into text). */
isQuarantined: boolean;
/** Present only when `isQuarantined` — a truthful notice, not boilerplate. */
quarantineNotice?: string;
/**
* The quarantined table/formula's OWN physical page, when it differs from
* `physicalPage` (a table often sits on the page after the paragraph that
* mentions it — verified on real data, not assumed). Falls back to
* `physicalPage` when absent. Only meaningful when `isQuarantined`.
*/
quarantinePhysicalPage?: number;
/** A rendered crop of the source table/formula, when reconstruction has produced one. Usually absent today. */
sourceCropUrl?: string;
}
export interface ChatMessage {
@@ -16,8 +33,17 @@ export interface ChatMessage {
decision?: string;
reason?: string;
grounded?: boolean;
/** True: the LLM paraphrased the evidence and it passed grounding+entailment. False: verbatim source quote (no generator configured, or a configured one that failed and abstained). */
generated?: boolean;
resolvedDrugId?: string;
createdAt: string;
/**
* Short suggested replies for a `decision: "clarify"` turn — e.g. ["Người
* lớn", "Trẻ em"] for an age-band question. Optional: the model doesn't
* always produce clean short options (an open-ended clarify has none),
* and the UI must fall back to free text either way.
*/
quickReplies?: string[];
}
export interface SendMessageRequest {