Spaces:
Sleeping
Sleeping
Commit History
-
fix: enforce patient's phase preference in API call, not LLM guidanceβ
KevinIsInCoding +1: Claude Sonnet 4.6Previously the research LLM was expected to forward profile.phases to the search tool β an unreliable pattern. Now the code sets phases directly from profile.phases for INTERVENTIONAL searches, ignoring whatever the LLM passed. EAP and OBSERVATIONAL searches are unaffected (phase filters don't apply there). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>276f805
-
perf: rank trials by phase, cap at 15, strip bloat, tighten defaults (#25)β
KevinIsInCoding +1: Claude Sonnet 4.6Unverified signatureTrial ranking (Phase 4 > Phase 3 > ... > EAP > Observational) replaces pure distance sorting so the highest-value trials surface first. Token reduction (~60-80% of tool-result payload): - _rank_and_slim: cap at 15 trials before LLM, strip summary/conditions/ keywords/age fields/std_ages/eligibility, reduce nearest_sites 5β3, drop intervention descriptions - max_tokens: research 8096β3000, bulk-parse eligibility 8192β4096 Default search radius: 100 miles β 20 miles Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>a009989 -
perf: add prompt caching to intake and research agents (#22)β
KevinIsInCoding +1: Claude Sonnet 4.6Unverified signatureWraps system prompts and tool lists with cache_control: ephemeral at all five API call sites. Cached tokens are billed at 10% of normal input rate, saving ~90% on repeated turns within a session. Adds cached_system() and cached_tools() helpers to llm.py so the pattern stays consistent and easy to update. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>5b5c80a
-
feat: structured eligibility assessment with per-criterion verdicts (#14)β
KevinIsInCoding +1: Claude Sonnet 4.6Unverified signature- Add agents/eligibility.py: two-step pipeline β bulk LLM parse of eligibility text into structured constraints, then deterministic code evaluation (Path A) for known patient fields; research LLM handles unclear criteria inline (Path B, no extra call) - Add data/criterion_keys.json: canonical key β patient/platform field mapping; extend without touching agent code - Add data/tools/{parse_criteria,parse_criteria_bulk,assess_eligibility}.json - Extend models.py: CriterionVerdict, ParsedConstraint, EligibilityCriterion, CriterionAssessment, TrialEligibilityReport - trials_api.py: extract full fields (sex, healthy_volunteers, std_ages, study_type, enrollment, conditions, keywords, interventions); remove 1000/500-char truncations; pageSize 200 β 1000 (fewer round trips) - agents/intake.py: accept onset_date/diagnosis_date (YYYY-MM) and compute months in Python β fixes LLM arithmetic drift on current date - agents/research.py: bulk parse + strip after each search; yield ("sβ¦e15864e -
feat: SRP refactor, streaming UX fix, and semantic disease detection (#12)β
KevinIsInCoding +3: Claude Sonnet 4.6, claude[bot], KevinIsInCodingUnverified signature* feat: SRP refactor, streaming UX fix, and semantic disease detection - Split 652-line clinical_trials_guru.py monolith into focused modules: config, models, tools, prompts, trials_api, _console, agents/intake, agents/research. clinical_trials_guru.py now ~60 lines of re-exports. - Move tool schemas and disease benchmark profiles to JSON files under data/; adding a new disease requires only a new JSON file, no code change. - Fix Gradio 6.x input-locking bug by switching all intake/research turns to Anthropic streaming API β inputs unblock after milliseconds, not 30s. - Replace brittle substring match_disease() with identify_disease tool: the intake agent calls identify_disease(standardized_name=...) when it semantically identifies the disease; system does reliable registry lookup via lookup_disease_profile(). Handles all languages, synonyms, and symptom descriptions that keyword matching could not. - Pin Gradio to >=6.14.0,<7.0.0 to prevent unexpected major-version brβ¦22195c1