diff --git a/clinicaltrials.js b/clinicaltrials.js index 0c8a00b..354f00b 100644 --- a/clinicaltrials.js +++ b/clinicaltrials.js @@ -30,7 +30,7 @@ export const api = { export const tools = { studies: { name: "studies", - description: "Search clinical trials with filters. Use AND, OR, NOT, and parentheses for grouping.", + description: "Search clinical trials with filters.", parameters: { type: "object", required: ["fields"], @@ -38,7 +38,7 @@ export const tools = { "query.cond": { type: "string", description: "Search for condition or disease" }, "query.term": { type: "string", - description: "Search other terms like age, phase, design, sponsor, keyword, etc.", + description: 'Search age, phase, design, sponsor, keyword, etc.', }, "query.locn": { type: "string", description: "Search for location (country, state, city, facility)" }, "query.titles": { type: "string", description: "Search in title" }, diff --git a/script.js b/script.js index b9c5c15..3e9cf49 100644 --- a/script.js +++ b/script.js @@ -34,7 +34,15 @@ $queryForm.addEventListener("submit", async (e) => { model: "gpt-4o-mini", stream: true, messages: [ - { role: "system", content: "Find studies that will have the most relevant answers to the user question" }, + { + role: "system", + content: ` +Find studies that will have the most relevant answers to the user question. +In query.*, don't use phrases as-is. Always identify the most relevant keywords, combining them with AND. +E.g. "violation by the FDA" becomes "violation AND FDA". +E.g. "improper adherence to safety and scientific integrity" becomes "adherence AND safety AND integrity" +`.trim(), + }, { role: "user", content: query }, ], tools: [{ type: "function", function: tools.studies }],