cite-agent 1.2.3__tar.gz → 1.2.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cite-agent might be problematic. Click here for more details.

Files changed (93) hide show
  1. {cite_agent-1.2.3/cite_agent.egg-info → cite_agent-1.2.5}/PKG-INFO +1 -1
  2. cite_agent-1.2.5/cite_agent/__version__.py +1 -0
  3. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/auth.py +1 -1
  4. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/cli.py +1 -1
  5. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/enhanced_ai_agent.py +84 -36
  6. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/updater.py +9 -6
  7. {cite_agent-1.2.3 → cite_agent-1.2.5/cite_agent.egg-info}/PKG-INFO +1 -1
  8. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent.egg-info/SOURCES.txt +1 -0
  9. {cite_agent-1.2.3 → cite_agent-1.2.5}/setup.py +1 -1
  10. {cite_agent-1.2.3 → cite_agent-1.2.5}/LICENSE +0 -0
  11. {cite_agent-1.2.3 → cite_agent-1.2.5}/MANIFEST.in +0 -0
  12. {cite_agent-1.2.3 → cite_agent-1.2.5}/README.md +0 -0
  13. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/__init__.py +0 -0
  14. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/account_client.py +0 -0
  15. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/agent_backend_only.py +0 -0
  16. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/ascii_plotting.py +0 -0
  17. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/backend_only_client.py +0 -0
  18. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/cli_conversational.py +0 -0
  19. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/cli_enhanced.py +0 -0
  20. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/cli_workflow.py +0 -0
  21. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/dashboard.py +0 -0
  22. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/rate_limiter.py +0 -0
  23. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/session_manager.py +0 -0
  24. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/setup_config.py +0 -0
  25. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/streaming_ui.py +0 -0
  26. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/telemetry.py +0 -0
  27. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/ui.py +0 -0
  28. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/web_search.py +0 -0
  29. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/workflow.py +0 -0
  30. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent/workflow_integration.py +0 -0
  31. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent.egg-info/dependency_links.txt +0 -0
  32. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent.egg-info/entry_points.txt +0 -0
  33. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent.egg-info/requires.txt +0 -0
  34. {cite_agent-1.2.3 → cite_agent-1.2.5}/cite_agent.egg-info/top_level.txt +0 -0
  35. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/BETA_LAUNCH_CHECKLIST.md +0 -0
  36. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/BETA_RELEASE_CHECKLIST.md +0 -0
  37. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/ENHANCED_CAPABILITIES.md +0 -0
  38. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/GROQ_RATE_LIMITS.md +0 -0
  39. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/INSTALL.md +0 -0
  40. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/PUBLISHING_PYPI.md +0 -0
  41. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/SECURE_PACKAGING_GUIDE.md +0 -0
  42. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/SECURITY_AUDIT.md +0 -0
  43. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/USER_GETTING_STARTED.md +0 -0
  44. {cite_agent-1.2.3 → cite_agent-1.2.5}/docs/playbooks/BETA_LAUNCH_PLAYBOOK.md +0 -0
  45. {cite_agent-1.2.3 → cite_agent-1.2.5}/requirements-dev.txt +0 -0
  46. {cite_agent-1.2.3 → cite_agent-1.2.5}/requirements.txt +0 -0
  47. {cite_agent-1.2.3 → cite_agent-1.2.5}/setup.cfg +0 -0
  48. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/__init__.py +0 -0
  49. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/__init__.py +0 -0
  50. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/auth_service/__init__.py +0 -0
  51. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/auth_service/auth_manager.py +0 -0
  52. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/graph/__init__.py +0 -0
  53. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/graph/knowledge_graph.py +0 -0
  54. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/llm_service/__init__.py +0 -0
  55. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/llm_service/llm_manager.py +0 -0
  56. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/paper_service/__init__.py +0 -0
  57. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/paper_service/openalex.py +0 -0
  58. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/performance_service/__init__.py +0 -0
  59. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/performance_service/rust_performance.py +0 -0
  60. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/__init__.py +0 -0
  61. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/chatbot.py +0 -0
  62. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/citation_manager.py +0 -0
  63. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/context_manager.py +0 -0
  64. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/conversation_manager.py +0 -0
  65. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/critical_paper_detector.py +0 -0
  66. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/enhanced_research.py +0 -0
  67. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/enhanced_synthesizer.py +0 -0
  68. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/query_generator.py +0 -0
  69. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/research_service/synthesizer.py +0 -0
  70. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/search_service/__init__.py +0 -0
  71. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/search_service/indexer.py +0 -0
  72. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/search_service/search_engine.py +0 -0
  73. {cite_agent-1.2.3 → cite_agent-1.2.5}/src/services/simple_enhanced_main.py +0 -0
  74. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/beta_launch_test_suite.py +0 -0
  75. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/enhanced/test_account_client.py +0 -0
  76. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/enhanced/test_archive_agent.py +0 -0
  77. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/enhanced/test_enhanced_agent_runtime.py +0 -0
  78. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/enhanced/test_reasoning_engine.py +0 -0
  79. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/enhanced/test_setup_config.py +0 -0
  80. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/enhanced/test_tool_framework.py +0 -0
  81. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/integration_test.py +0 -0
  82. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/test_truth_seeking_comprehensive.py +0 -0
  83. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_accuracy_system.py +0 -0
  84. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_agent_live.py +0 -0
  85. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_backend_local.py +0 -0
  86. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_cerebras_comparison.py +0 -0
  87. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_improved_prompt.py +0 -0
  88. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_qualitative_robustness.py +0 -0
  89. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_qualitative_system.py +0 -0
  90. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_truth_seeking_chinese.py +0 -0
  91. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_truth_seeking_comprehensive.py +0 -0
  92. {cite_agent-1.2.3 → cite_agent-1.2.5}/tests/validation/test_truth_seeking_real.py +0 -0
  93. {cite_agent-1.2.3 → cite_agent-1.2.5}/tools/security_audit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cite-agent
3
- Version: 1.2.3
3
+ Version: 1.2.5
4
4
  Summary: Terminal AI assistant for academic research with citation verification
5
5
  Home-page: https://github.com/Spectating101/cite-agent
6
6
  Author: Cite-Agent Team
@@ -0,0 +1 @@
1
+ __version__ = "1.2.5"
@@ -25,7 +25,7 @@ class AuthManager:
25
25
  self.config_dir.mkdir(exist_ok=True)
26
26
 
27
27
  self.session_file = self.config_dir / "session.json"
28
- self.api_base = os.getenv("NOCTURNAL_AUTH_API", "https://api.nocturnal.dev")
28
+ self.api_base = os.getenv("NOCTURNAL_AUTH_API", "https://cite-agent-api-720dfadd602c.herokuapp.com")
29
29
 
30
30
  def login(self, email: str, password: str) -> Dict:
31
31
  """
@@ -743,7 +743,7 @@ Examples:
743
743
 
744
744
  # Handle version
745
745
  if args.version:
746
- print("Cite Agent v1.2.2")
746
+ print("Cite Agent v1.2.5")
747
747
  print("AI Research Assistant with real data integration")
748
748
  return
749
749
 
@@ -2458,6 +2458,47 @@ class EnhancedNocturnalAgent:
2458
2458
  "analysis_mode": analysis_mode # NEW: qualitative, quantitative, or mixed
2459
2459
  }
2460
2460
 
2461
+ def _is_query_too_vague_for_apis(self, question: str) -> bool:
2462
+ """
2463
+ Detect if query is too vague to warrant API calls
2464
+ Returns True if we should skip APIs and just ask clarifying questions
2465
+ """
2466
+ question_lower = question.lower()
2467
+
2468
+ # Pattern 1: Multiple years without SPECIFIC topic (e.g., "2008, 2015, 2019")
2469
+ import re
2470
+ years_pattern = r'\b(19\d{2}|20\d{2})\b'
2471
+ years = re.findall(years_pattern, question)
2472
+ if len(years) >= 2:
2473
+ # Multiple years - check if there's a SPECIFIC topic beyond just "papers on"
2474
+ # Generic terms that don't add specificity
2475
+ generic_terms = ['papers', 'about', 'on', 'regarding', 'concerning', 'related to']
2476
+ # Remove generic terms and check what's left
2477
+ words = question_lower.split()
2478
+ content_words = [w for w in words if w not in generic_terms and not re.match(r'\d{4}', w)]
2479
+ # If fewer than 2 meaningful content words, it's too vague
2480
+ if len(content_words) < 2:
2481
+ return True # Too vague: "papers on 2008, 2015, 2019" needs topic
2482
+
2483
+ # Pattern 2: Market share without market specified
2484
+ if 'market share' in question_lower:
2485
+ market_indicators = ['analytics', 'software', 'government', 'data', 'cloud', 'sector', 'industry']
2486
+ if not any(indicator in question_lower for indicator in market_indicators):
2487
+ return True # Too vague: needs market specification
2488
+
2489
+ # Pattern 3: Comparison without metric (compare X and Y)
2490
+ if any(word in question_lower for word in ['compare', 'versus', 'vs', 'vs.']):
2491
+ metric_indicators = ['revenue', 'market cap', 'sales', 'growth', 'profit', 'valuation']
2492
+ if not any(indicator in question_lower for indicator in metric_indicators):
2493
+ return True # Too vague: needs metric specification
2494
+
2495
+ # Pattern 4: Ultra-short queries without specifics (< 4 words)
2496
+ word_count = len(question.split())
2497
+ if word_count <= 3 and '?' in question:
2498
+ return True # Too short and questioning - likely needs clarification
2499
+
2500
+ return False # Query seems specific enough for API calls
2501
+
2461
2502
  async def process_request(self, request: ChatRequest) -> ChatResponse:
2462
2503
  """Process request with full AI capabilities and API integration"""
2463
2504
  try:
@@ -2474,48 +2515,55 @@ class EnhancedNocturnalAgent:
2474
2515
  if debug_mode:
2475
2516
  print(f"🔍 Request analysis: {request_analysis}")
2476
2517
 
2518
+ # Check if query is too vague - skip API calls to save tokens
2519
+ is_vague = self._is_query_too_vague_for_apis(request.question)
2520
+ if debug_mode and is_vague:
2521
+ print(f"🔍 Query detected as VAGUE - skipping API calls, asking for clarification")
2522
+
2477
2523
  # Call appropriate APIs (Archive, FinSight) - BOTH production and dev mode
2478
2524
  api_results = {}
2479
2525
  tools_used = []
2480
2526
 
2481
- # Archive API for research
2482
- if "archive" in request_analysis.get("apis", []):
2483
- result = await self.search_academic_papers(request.question, 5)
2484
- if "error" not in result:
2485
- api_results["research"] = result
2486
- tools_used.append("archive_api")
2487
-
2488
- # FinSight API for financial data
2489
- if "finsight" in request_analysis.get("apis", []):
2490
- tickers = self._extract_tickers_from_text(request.question)
2491
- if not tickers:
2492
- # Try common company name mappings
2493
- question_lower = request.question.lower()
2494
- if "apple" in question_lower:
2495
- tickers = ["AAPL"]
2496
- elif "tesla" in question_lower:
2497
- tickers = ["TSLA"]
2498
- elif "microsoft" in question_lower:
2499
- tickers = ["MSFT"]
2500
- elif "google" in question_lower or "alphabet" in question_lower:
2501
- tickers = ["GOOGL"]
2502
-
2503
- if debug_mode:
2504
- print(f"🔍 Extracted tickers: {tickers}")
2527
+ # Skip API calls if query is too vague
2528
+ if not is_vague:
2529
+ # Archive API for research
2530
+ if "archive" in request_analysis.get("apis", []):
2531
+ result = await self.search_academic_papers(request.question, 5)
2532
+ if "error" not in result:
2533
+ api_results["research"] = result
2534
+ tools_used.append("archive_api")
2505
2535
 
2506
- if tickers:
2507
- # Call FinSight with proper endpoint format
2508
- if debug_mode:
2509
- print(f"🔍 Calling FinSight API: calc/{tickers[0]}/revenue")
2510
- financial_data = await self._call_finsight_api(f"calc/{tickers[0]}/revenue")
2536
+ # FinSight API for financial data
2537
+ if "finsight" in request_analysis.get("apis", []):
2538
+ tickers = self._extract_tickers_from_text(request.question)
2539
+ if not tickers:
2540
+ # Try common company name mappings
2541
+ question_lower = request.question.lower()
2542
+ if "apple" in question_lower:
2543
+ tickers = ["AAPL"]
2544
+ elif "tesla" in question_lower:
2545
+ tickers = ["TSLA"]
2546
+ elif "microsoft" in question_lower:
2547
+ tickers = ["MSFT"]
2548
+ elif "google" in question_lower or "alphabet" in question_lower:
2549
+ tickers = ["GOOGL"]
2550
+
2511
2551
  if debug_mode:
2512
- print(f"🔍 FinSight returned: {list(financial_data.keys()) if financial_data else None}")
2513
- if financial_data and "error" not in financial_data:
2514
- api_results["financial"] = financial_data
2515
- tools_used.append("finsight_api")
2516
- else:
2517
- if debug_mode and financial_data:
2518
- print(f"🔍 FinSight error: {financial_data.get('error')}")
2552
+ print(f"🔍 Extracted tickers: {tickers}")
2553
+
2554
+ if tickers:
2555
+ # Call FinSight with proper endpoint format
2556
+ if debug_mode:
2557
+ print(f"🔍 Calling FinSight API: calc/{tickers[0]}/revenue")
2558
+ financial_data = await self._call_finsight_api(f"calc/{tickers[0]}/revenue")
2559
+ if debug_mode:
2560
+ print(f"🔍 FinSight returned: {list(financial_data.keys()) if financial_data else None}")
2561
+ if financial_data and "error" not in financial_data:
2562
+ api_results["financial"] = financial_data
2563
+ tools_used.append("finsight_api")
2564
+ else:
2565
+ if debug_mode and financial_data:
2566
+ print(f"🔍 FinSight error: {financial_data.get('error')}")
2519
2567
 
2520
2568
  # PRODUCTION MODE: Send to backend LLM with API results
2521
2569
  if self.client is None:
@@ -54,6 +54,13 @@ class NocturnalUpdater:
54
54
  except Exception:
55
55
  pass
56
56
 
57
+ # Try version file
58
+ try:
59
+ from cite_agent.__version__ import __version__
60
+ return __version__
61
+ except Exception:
62
+ pass
63
+
57
64
  # Fallback to pkg_resources (deprecated)
58
65
  if pkg_resources:
59
66
  try:
@@ -61,12 +68,8 @@ class NocturnalUpdater:
61
68
  except Exception:
62
69
  pass
63
70
 
64
- # Last resort: try to get version from installed package
65
- try:
66
- import cite_agent
67
- return getattr(cite_agent, '__version__', '1.0.0')
68
- except ImportError:
69
- return "1.0.0"
71
+ # Last resort
72
+ return "1.0.0"
70
73
 
71
74
  def check_for_updates(self) -> Optional[Dict[str, Any]]:
72
75
  """Check if updates are available"""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cite-agent
3
- Version: 1.2.3
3
+ Version: 1.2.5
4
4
  Summary: Terminal AI assistant for academic research with citation verification
5
5
  Home-page: https://github.com/Spectating101/cite-agent
6
6
  Author: Cite-Agent Team
@@ -5,6 +5,7 @@ requirements-dev.txt
5
5
  requirements.txt
6
6
  setup.py
7
7
  cite_agent/__init__.py
8
+ cite_agent/__version__.py
8
9
  cite_agent/account_client.py
9
10
  cite_agent/agent_backend_only.py
10
11
  cite_agent/ascii_plotting.py
@@ -7,7 +7,7 @@ long_description = readme_path.read_text() if readme_path.exists() else "Termina
7
7
 
8
8
  setup(
9
9
  name="cite-agent",
10
- version="1.2.3",
10
+ version="1.2.5",
11
11
  author="Cite-Agent Team",
12
12
  author_email="contact@citeagent.dev",
13
13
  description="Terminal AI assistant for academic research with citation verification",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes