From 6f20ade780ce94b9ffb88b3aa9d1716785c0b4ce Mon Sep 17 00:00:00 2001 From: William Jeynes Date: Thu, 19 Feb 2026 10:07:39 +0000 Subject: [PATCH] Make open webpage more appealing --- agent/prompts/trigger.txt | 1 - agent/tools/retreiveExamples.ts | 1 - agent/tools/triggerEventTools.ts | 11 +++++------ agent/tools/webpageFetch.ts | 2 -- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/agent/prompts/trigger.txt b/agent/prompts/trigger.txt index 52e77df..704e4f6 100644 --- a/agent/prompts/trigger.txt +++ b/agent/prompts/trigger.txt @@ -22,6 +22,5 @@ Use your abilities to look between the lines and produce some insightful analysi Events will be reordered as part of processing, each statement must stand alone The preceeding messages act as examples of previous responses to potentially ficitonal events and scores given. -Analysis should only be completed for proposed events that would graner >0.7 points Lets go through it step by step \ No newline at end of file diff --git a/agent/tools/retreiveExamples.ts b/agent/tools/retreiveExamples.ts index d26d823..a63317b 100644 --- a/agent/tools/retreiveExamples.ts +++ b/agent/tools/retreiveExamples.ts @@ -238,7 +238,6 @@ async function ensureExampleClaimJsonlLoaded(): Promise { if (jsonlLoaded) return; logger.info("Initializing JSONL ranking..."); - //TODO: make jsonl parsins const stream = fs.createReadStream(JSONL_PATH); const rl = readline.createInterface({ diff --git a/agent/tools/triggerEventTools.ts b/agent/tools/triggerEventTools.ts index 595bebe..e765765 100644 --- a/agent/tools/triggerEventTools.ts +++ b/agent/tools/triggerEventTools.ts @@ -27,16 +27,15 @@ const webSearch = tool( ); const openWebpage = tool( - async ({ a, b }) => { + async ({ a }) => { const data = await extractWebpageContent(a); - return rankAndDisplayData(data, b); + return data; }, { - name: "OpenWebpage", - description: "Opens webpage and returns most relevent snippets", + name: "WebRetreiveUrl", + description: "Fetches and reads the FULL contents of a webpage. REQUIRED when detailed or accurate information is needed.", schema: z.object({ - a: z.string().describe("URL"), - b: z.string().describe("What to match against in webpage content"), + a: z.url().describe("URL") }), } ); diff --git a/agent/tools/webpageFetch.ts b/agent/tools/webpageFetch.ts index 8f11fc3..74c9fd6 100644 --- a/agent/tools/webpageFetch.ts +++ b/agent/tools/webpageFetch.ts @@ -29,6 +29,4 @@ export async function extractWebpageContent(url: string) : Promise{ } } -//TODO: Extract, rank snippets - //console.log(await extractWebpageContent("https://www.bbc.co.uk/news/live/c74wd01egvyt")) \ No newline at end of file