Spaces:
Build error
Build error
Commit History
-
demo launches
Joseph PollackUnverified signature53c4c46
-
adds local embeddings and huggingface inference as defaults , adds tests , improves precommit and ci
Joseph PollackUnverified signaturecd46aca -
adds tests , integration tests , github readme , and more!
Joseph PollackUnverified signature96aa062 -
style: auto-format 4 files (ruff)
a805769
-
feat: implement dual-mode architecture (Simple + Advanced) (#45)
Unverified signature* docs: add dual-mode architecture specification Senior agent reviewed and approved. Key documents: - 00_SITUATION_AND_PLAN.md: Problem analysis, branch states, recommended path - 01_ARCHITECTURE_SPEC.md: Dual-mode architecture (Simple + Advanced) - 02_IMPLEMENTATION_PHASES.md: 6-phase implementation plan - 03_IMMEDIATE_ACTIONS.md: Quick reference checklist Architecture: pydantic-ai (structured outputs) + Microsoft Agent Framework (orchestration) are COMPLEMENTARY, not competing. Dual-mode allows graceful degradation to free tier when no API keys available. * docs: add follow-up review request for senior agent verification * feat: implement dual-mode architecture (Simple + Advanced) Phase 1 - Pydantic-AI Improvements (Simple Mode): - Add HuggingFace provider support in judges.py with get_model() - Add huggingface_model and hf_token config fields - Tests in test_judges_factory.py Phase 2 - Orchestrator Factory: - Implement create_orchestrator() with auto-detection logic - Simple m…b2929fc -
fix: address CodeRabbit feedback
- Sort .env.example model keys alphabetically. - Narrow return type of create_demo() to gr.ChatInterface. - Confirmed embedding model vars are already wired in src/utils/config.py.be7e1a2 -
fix: repair Gradio accordion bug and cleanup env vars
- Unwrapped ChatInterface from gr.Blocks to fix settings accordion state (fixes P1_GRADIO_SETTINGS_CLEANUP). - Updated .env.example with missing variables and removed dead ones. - Updated documentation for the fix.fcc601a -
fix(magentic): defensive text extraction & cleanup biorxiv refs
Add _extract_text to fix ChatMessage object output bug. Update bioRxiv strings to Europe PMC. Add regression test.3bfd42c -
fix(config): increase max iterations to 10
Addressed P0-004 by increasing default max_iterations from 5 to 10 to allow deep search loops to complete successfully.72b2667 -
refactor(tools): replace BioRxiv with Europe PMC (Phase 01)
Replaced broken BioRxivTool with EuropePMCTool which supports keyword search. Updated all agents, MCP tools, and examples to use the new tool. Deleted legacy BioRxiv implementation.2f8ae1f -
refactor: enhance Gradio UI for improved user experience
- Updated header to include a more descriptive title and streamlined text. - Enhanced chat interface with clearer example prompts and added settings accordion for configuration. - Improved footer to clarify research tool limitations and active MCP server connection. These changes aim to provide a more intuitive and informative interface for users interacting with the drug repurposing research agent.291b9e6 -
fix: simplify Gradio UI to fit single viewport
- Reduce header to 2 lines (title + one-line description) - Remove MCP Tools tabs UI (MCP server still active at /gradio_api/mcp/) - Simplify examples (just questions, no extra params shown) - Minimal footer with disclaimer and MCP endpoint - Remove unused mcp_tools imports from app.py This fixes the header cutoff issue in HuggingFace Spaces iframe by reducing total content to fit within standard viewport height.8dc3e50 -
fix: address CodeRabbit feedback and P0 blockers
Code Fixes (HIGH priority): - Add API key/provider validation to prevent silent auth failures - Fix hardcoded manager model in orchestrator_magentic.py (now uses settings.openai_model) - Add bounds checking to JSON extraction in judges.py (prevents IndexError) - Fix fragile test assertion in test_judges_hf.py Code Quality (MEDIUM priority): - Add explicit type annotation for models_to_try: list[str] - Fix structured logging (f-string → structured params) - Align fallback query count (3 queries) between handlers Test Improvements: - Add @pytest.mark.unit decorator to TestHFInferenceJudgeHandler Documentation Sync: - Update Phase 3 docs to match actual implementation: - __init__ signature (simplified, no inline imports) - _extract_json (string split with bounds checking) - _call_with_retry (tenacity decorator, asyncio.get_running_loop()) - assess method (simplified model loop) - Update Phase 4 docs with ChatInterface additional_inputs for BYOK All 104 tests pass.f985224 -
feat: implement HFInferenceJudgeHandler for free-tier AI analysis
Replace MockJudgeHandler with real AI analysis using HuggingFace Inference API: - Add HFInferenceJudgeHandler with chat_completion API - Model fallback chain: Llama 3.1 → Mistral → Zephyr (ungated) - Robust JSON extraction (handles markdown blocks, nested braces) - Tenacity retry with exponential backoff for rate limits - Fix app.py to use HF Inference when no paid API keys present Priority: User API key → Env API key → HF Inference (free) Hackathon judges now get real AI analysis without needing API keys. Set HF_TOKEN as Space secret for best model (Llama 3.1).7fab6d4
-
fix: disable ssr_mode to resolve intermittent gradio hydration issues
420d8ba -
fix: resolve Gradio UI cutoff by removing fill_height=True and restructuring layout
87de5ef -
fix: correct UI layout ordering - title at top
e4a1129 -
fix: move title/description into ChatInterface for proper HF Spaces layout
Root cause: gr.Markdown above gr.ChatInterface with fill_height=True causes layout competition where ChatInterface consumes all viewport space, pushing the Markdown behind the HuggingFace banner. Solution: Use ChatInterface's native title/description parameters instead of a separate gr.Markdown block. This is the Gradio-intended pattern for full-height chat layouts. Investigation documented in docs/bugs/002_gradio_ui_investigation.md998d05d -
fix: upgrade Gradio SDK to 6.0.1 and add fill_height for HF Spaces UI fix
Root cause: HuggingFace Spaces was deploying with sdk_version 5.33.0, but the UI cutoff bug (top content hidden beneath HF banner) was fixed in Gradio 5.36 via PR #11427. Changes: - README.md: sdk_version "5.33.0" → "6.0.1" (latest stable) - src/app.py: Added fill_height=True to gr.Blocks() for proper layout - docs/bugs/001_gradio_ui_cutoff.md: Full investigation documentation Fixes #31 References: - https://github.com/gradio-app/gradio/issues/11417 - https://github.com/gradio-app/gradio/pull/11427f236de1 -
fix: address CodeRabbit review feedback
- Move network reachability check to runtime in test_clinicaltrials.py (avoids 5s delay at test collection time) - Add explicit api_provider validation in app.py (raises ValueError for unsupported providers instead of silent fallback)923641c -
fix: use config settings for model names instead of hardcoded values
ClaudeUnverified signatureModel names in app.py were hardcoded to "gpt-4o" and "claude-sonnet-4-20250514". Now uses settings.openai_model and settings.anthropic_model from config, allowing model names to be configured via environment variables.f5747b1 -
feat: add demo mode warnings and BYOK (Bring Your Own Key) support
ClaudeUnverified signatureChanges: - Add clear "Demo Mode" warning when no API keys are configured - Add BYOK feature allowing users to input their own API key in Gradio UI - Improve MockJudgeHandler to extract meaningful info from real search results instead of hardcoded "Drug A", "Drug B" placeholders - Add API provider selection (OpenAI/Anthropic) for user-provided keys - Skip integration tests when external APIs are unreachable (SSL/network issues) This fixes the issue where users saw mock data ("Drug A", "Drug B", "Finding 1") without any indication they were in demo mode. Now: 1. Users are clearly informed when running in demo mode 2. Users can enter their own API key for full AI-powered analysis 3. Demo mode shows real search results with extracted findings4d87419 -
fix: upgrade Gradio to 5.32.0+ for MCP server support
- Update gradio[mcp]>=5.32.0 in pyproject.toml and requirements.txt - Set sdk_version: "5.33.0" in README.md for HuggingFace Spaces - Remove deprecated `type="messages"` param (messages is default in 6.x) - Keep `mcp_server=True` which works in both 5.32+ and 6.x This is the proper fix for HuggingFace Spaces deployment: - mcp_server param requires Gradio 5.32.0+ - Messages format is now default, no explicit type needed - 101 tests pass, 71% coverage1812a2a -
feat: add smoke tests and fix Gradio 6.x compatibility
- Add smoke tests for app initialization (catches config errors before deploy) - Fix Gradio 6.x breaking changes: - Remove `theme` param from gr.Blocks (removed in 6.x) - Remove `type` param from gr.ChatInterface (removed in 6.x) - Add typer to dev dependencies (required by Gradio CLI for smoke tests) Smoke tests would have caught the previous deployment failures: - Invalid examples format - Gradio API changes 101 tests passing, 71% coverage2bd9462 -
fix: Gradio examples format for additional_inputs
ChatInterface with additional_inputs requires nested list format where each example includes values for all inputs. Before: ['question1', 'question2', ...] After: [['question1', 'simple'], ['question2', 'simple'], ...]f66a862 -
fix: wire analyze_hypothesis MCP tool into Gradio app
Senior review found that analyze_hypothesis existed in mcp_tools.py but wasn't exposed through the Gradio MCP interface. Fixed.521d97d -
feat: enhance Gradio UI with MCP server support and new tool interfaces
- Updated the Gradio app to include support for the MCP server, enabling integration with Claude Desktop. - Added new interfaces for PubMed, Clinical Trials, bioRxiv, and a comprehensive search tool, enhancing the research capabilities. - Modified the demo creation function to reflect these updates and ensure a seamless user experience. Files modified: - src/app.py10e234c -
feat: Phase 11 bioRxiv Preprint Integration (#19)
Unverified signature* feat: Implement Phase 11 (bioRxiv Preprint Integration) * chore: add .mypy_cache to .gitignore * fix: address CodeRabbit review feedback for bioRxiv tool - Catch httpx.RequestError for network failures (major issue) - Use SourceName type alias in Citation model (DRY) - Only add '...' suffix when abstract is truncated - Add test for network error handlinge67c99f -
refactor: address CodeRabbit nitpicks for Phase 10
- Centralize SourceName type alias in models.py - Update search_handler.py to use SourceName (reduces cast brittleness) - Update app.py intro text to mention ClinicalTrials.gov - Update run_search.py docstring for multi-source search - DRY test setup with mock_requests_get fixture - Speed up error test by patching tenacity retry stop condition1bc9785 -
feat: Implement Phase 10 (ClinicalTrials.gov) with requests
4e2ccbf -
feat: Complete Phase 9 Source Cleanup (Remove WebTool) (#14)
* feat: complete Phase 9 source cleanup - Removed WebTool (src/tools/websearch.py) and related tests - Updated SearchHandler and models to support only PubMed - Refactored all examples and tests to remove web search dependencies - Added verification tests to ensure no WebTool references remain - Fixed all unit tests to align with strict 'pubmed' source typing * fix: address CodeRabbit review feedback - Deduplicate tenacity dependency in pyproject.toml - Remove 'and web' from search agent description - Normalize Citation source to 'pubmed' in search agent - Update app.py markdown to remove web search references - Update embeddings demo with realistic PubMed URL/author - Enhance SearchHandler tests to verify multi-tool aggregation * refactor: replace mock data with real PubMed data in embeddings demo * fix: address CodeRabbit review feedback - Fix nested test_search_handler_pubmed_only (was inside another test, never ran) - Improve test_no_webtool_references to catch `from src.tool…cd004e1
-
fix: address CodeRabbit Phase 6 review feedback
- Dockerfile: Add curl for HEALTHCHECK, use specific extras (not --all-extras) - app.py: Tighten Magentic mode key detection to require OpenAI specifically - embeddings.py: Move structlog import to module level - test_embeddings.py: Remove redundant numpy import506a9c0 -
fix: address CodeRabbit Phase 5 review feedback
Critical fixes: - Fix invalid model names (gpt-5.1 → gpt-4o, claude-sonnet-4-5 → claude-sonnet-4-20250514) - Add OpenAI key validation in MagenticOrchestrator with clear error message - Document Magentic mode's OpenAI-only requirement Nitpicks: - Add streaming icon to AgentEvent.to_markdown() - Use exact equality for PubMed placeholder detection - Update app.py info text for API key requirements - Add language identifiers to markdown code blocks in docsd247864 -
fix: linting and types for phase 5
1922dbd -
refactor(phase4): address CodeRabbit review
- Pin uv version in Dockerfile and add non-root user - Use OrchestratorConfig for timeout in app.py - Use timezone.utc for timestamps in models.py36983ae -
feat(phase4): Orchestrator and UI complete
25c3a8b
-
adds scaffolding
Joseph Pollack6fbbcda