Spaces:
Sleeping
Sleeping
| from app.services.research_context_tools import plan_research_context_tools | |
| def test_lazy_context_skips_tools_for_casual_turn(): | |
| plan = plan_research_context_tools( | |
| agent_id="chat", | |
| query="can we think aloud for a minute?", | |
| selection_text="", | |
| knowledge_mode="net_support", | |
| ) | |
| assert not plan.use_project_context | |
| assert not plan.use_memory_context | |
| assert not plan.use_web_search | |
| def test_greeting_uses_only_tiny_profile_name_memory(): | |
| plan = plan_research_context_tools( | |
| agent_id="chat", | |
| query="hi", | |
| selection_text="", | |
| knowledge_mode="net_support", | |
| ) | |
| assert plan.use_memory_context | |
| assert plan.memory_mode == "profile" | |
| assert plan.memory_query == "preferred name" | |
| assert not plan.use_project_context | |
| assert not plan.use_web_search | |
| def test_lazy_context_fetches_project_context_for_paper_questions(): | |
| plan = plan_research_context_tools( | |
| agent_id="pair_buddy", | |
| query="What papers are uploaded in this project?", | |
| selection_text="", | |
| knowledge_mode="net_support", | |
| ) | |
| assert plan.use_project_context | |
| assert not plan.use_web_search | |
| def test_lazy_context_fetches_memory_for_profile_questions(): | |
| plan = plan_research_context_tools( | |
| agent_id="chat", | |
| query="What do you remember about my learning style?", | |
| selection_text="", | |
| knowledge_mode="net_support", | |
| ) | |
| assert plan.use_memory_context | |
| assert plan.memory_mode == "profile" | |
| assert not plan.use_project_context | |
| def test_vague_last_time_memory_request_asks_for_time_anchor_first(): | |
| plan = plan_research_context_tools( | |
| agent_id="chat", | |
| query="what did I study last time?", | |
| selection_text="", | |
| knowledge_mode="net_support", | |
| ) | |
| assert plan.needs_memory_clarification | |
| assert not plan.use_memory_context | |
| assert "date" in plan.clarification_prompt.lower() | |
| def test_lazy_context_fetches_web_for_current_external_questions(): | |
| plan = plan_research_context_tools( | |
| agent_id="pair_buddy", | |
| query="What is the latest DeepSeek model?", | |
| selection_text="", | |
| knowledge_mode="net_support", | |
| ) | |
| assert plan.use_web_search | |
| assert not plan.use_project_context | |
| def test_content_only_uses_project_context_instead_of_web(): | |
| plan = plan_research_context_tools( | |
| agent_id="chat", | |
| query="Explain attention heads", | |
| selection_text="", | |
| knowledge_mode="content_only", | |
| ) | |
| assert plan.use_project_context | |
| assert not plan.use_web_search | |