From 6ae551a93fee4e31f38b73928ae9085122fd575b Mon Sep 17 00:00:00 2001 From: William Jeynes Date: Mon, 2 Mar 2026 14:58:26 +0000 Subject: [PATCH] Ensure date is passed to pipeline. Fix woring --- agent/prompts/hydratePrompt.ts | 1 + agent/prompts/trigger.txt | 2 +- agent/state.ts | 1 + supporting/Wrapper/run.ts | 2 ++ supporting/scorer/views/rank.py | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/agent/prompts/hydratePrompt.ts b/agent/prompts/hydratePrompt.ts index 9b71810..7084b96 100644 --- a/agent/prompts/hydratePrompt.ts +++ b/agent/prompts/hydratePrompt.ts @@ -10,6 +10,7 @@ export async function hydratePrompt(path: string, state: any) : Promise raw = raw.replace("###TITLE###", state.disinformationTitle); raw = raw.replace("###LM###", state.messages.at(-1).content); raw = raw.replace("###NTITLE###", state.normalizedClaim); + raw = raw.replace("###CDATE###", state.date); if (raw.indexOf("###TECLAIM###") != -1) { const title = state.proposedTriggerEvent[state.proposedTriggerEventIndex].Event diff --git a/agent/prompts/trigger.txt b/agent/prompts/trigger.txt index 52e77df..7c29b1e 100644 --- a/agent/prompts/trigger.txt +++ b/agent/prompts/trigger.txt @@ -5,7 +5,7 @@ There is a false disinformation claim circulating: ###NTITLE### Produce up-to 5 specific "trigger events" that happened that could have led to the spread of this disinformation. -Remember the time frame of the disinformation campaign: {{CAMPAIGN_DATE}} +Remember the time frame of the disinformation campaign: ###CDATE### Include no information or events that would not have been available at the time. Produce no more text other than the json. diff --git a/agent/state.ts b/agent/state.ts index b4388fc..896e263 100644 --- a/agent/state.ts +++ b/agent/state.ts @@ -17,6 +17,7 @@ export const ProposedTriggerEventArray = z.array(ProposedTriggerEvent); export const MessagesState = new StateSchema({ disinformationTitle: z.string(), + date: z.string(), messages: MessagesValue, proposedTriggerEvent: ProposedTriggerEventArray, proposedTriggerEventIndex: z.int(), diff --git a/supporting/Wrapper/run.ts b/supporting/Wrapper/run.ts index a83f08a..29f0c42 100644 --- a/supporting/Wrapper/run.ts +++ b/supporting/Wrapper/run.ts @@ -16,6 +16,7 @@ const client = new Client({ apiUrl: API_URL }); type Claim = { documentUrl: string; text: string; + dateCreated: string; [key: string]: any; }; @@ -43,6 +44,7 @@ async function processClaim(claim: Claim): Promise { { input: { disinformationTitle: claim.text, + date: claim.dateCreated }, streamMode: "values", config: { diff --git a/supporting/scorer/views/rank.py b/supporting/scorer/views/rank.py index 7235f73..3c76e93 100644 --- a/supporting/scorer/views/rank.py +++ b/supporting/scorer/views/rank.py @@ -73,7 +73,7 @@ def render(): st.markdown(c.get("reasoningWhyRelevant")) st.markdown("---") - if st.button("Submit PERFECT Ranking"): + if st.button("Submit Ranking"): n = len(order)