h-ai-brain 0.0.4__tar.gz → 0.0.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.
Files changed (52) hide show
  1. {h_ai_brain-0.0.4/src/h_ai_brain.egg-info → h_ai_brain-0.0.5}/PKG-INFO +1 -1
  2. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/pyproject.toml +1 -1
  3. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/application/web_docs_service.py +1 -0
  4. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/web_docs_link_detector.py +2 -0
  5. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/playwright/playwright_web_content_fetcher.py +13 -3
  6. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5/src/h_ai_brain.egg-info}/PKG-INFO +1 -1
  7. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/LICENSE +0 -0
  8. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/NOTICE.txt +0 -0
  9. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/setup.cfg +0 -0
  10. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/__init__.py +0 -0
  11. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/application/__init__.py +0 -0
  12. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/application/hai_service.py +0 -0
  13. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/application/system_prompts/__init__.py +0 -0
  14. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/application/system_prompts/roles/__init__.py +0 -0
  15. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/__init__.py +0 -0
  16. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/reasoning/__init__.py +0 -0
  17. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/reasoning/llm_chat_repository.py +0 -0
  18. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/reasoning/llm_generate_respository.py +0 -0
  19. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/reasoning/llm_tool_repository.py +0 -0
  20. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/reasoning/text_analysis.py +0 -0
  21. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/reasoning/tool_message.py +0 -0
  22. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/__init__.py +0 -0
  23. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/doc_link_scorer_service.py +0 -0
  24. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/documentation_pattern_repository.py +0 -0
  25. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/gitbook/__init__.py +0 -0
  26. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/gitbook/text_chapter.py +0 -0
  27. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/gitbook/text_page.py +0 -0
  28. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/gitbook_web_fetcher_service.py +0 -0
  29. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/web_docs/web_link.py +0 -0
  30. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/webpages/__init__.py +0 -0
  31. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/webpages/web_fetcher_repository.py +0 -0
  32. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/domain/webpages/web_text_fetcher_repository.py +0 -0
  33. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/__init__.py +0 -0
  34. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/beautifulsoup/__init__.py +0 -0
  35. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/beautifulsoup/soup_processor.py +0 -0
  36. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/__init__.py +0 -0
  37. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/data_handler.py +0 -0
  38. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/llm_response_cleaner.py +0 -0
  39. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/__init__.py +0 -0
  40. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/models/__init__.py +0 -0
  41. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/models/ollama_chat_message.py +0 -0
  42. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/models/ollama_chat_session.py +0 -0
  43. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/ollama_chat_repository.py +0 -0
  44. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/ollama_generate_repository.py +0 -0
  45. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/ollama/ollama_tool_repository.py +0 -0
  46. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/prompt_helper.py +0 -0
  47. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/llm/prompt_loader.py +0 -0
  48. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai/infrastructure/playwright/__init__.py +0 -0
  49. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai_brain.egg-info/SOURCES.txt +0 -0
  50. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai_brain.egg-info/dependency_links.txt +0 -0
  51. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai_brain.egg-info/requires.txt +0 -0
  52. {h_ai_brain-0.0.4 → h_ai_brain-0.0.5}/src/h_ai_brain.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h_ai_brain
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: AI Research agent API
5
5
  Author-email: shoebill <shoebill.hai@gmail.com>
6
6
  Classifier: Programming Language :: Python :: 3
@@ -4,7 +4,7 @@
4
4
 
5
5
  [project]
6
6
  name = "h_ai_brain"
7
- version = "0.0.4"
7
+ version = "0.0.5"
8
8
  authors = [
9
9
  {name = "shoebill", email = "shoebill.hai@gmail.com"},
10
10
  ]
@@ -23,6 +23,7 @@ class WebDocsService:
23
23
  async def discover_documentation(self, website_url: str) -> Optional[List[TextPage]]:
24
24
  detected_links = await self.detect_documentation_links(website_url)
25
25
  for link in detected_links:
26
+ print(f"Fetching {link.url}")
26
27
  gitbook_fetcher = GitbookWebFetcherService(link.url)
27
28
  gitbook_pages = await gitbook_fetcher.fetch()
28
29
  return gitbook_pages
@@ -16,6 +16,8 @@ class WebDocsLinkDetector:
16
16
  doc_links = []
17
17
 
18
18
  web_content = await self.web_fetcher.fetch(website_url)
19
+ if not web_content:
20
+ return doc_links
19
21
 
20
22
  soup_processor = SoupProcessor(web_content)
21
23
  web_links = soup_processor.extract_links(website_url)
@@ -19,7 +19,10 @@ class PlayWrightWebContentFetcher(WebFetcherRepository):
19
19
 
20
20
  async def fetch(self, url: str) -> Optional[str]:
21
21
  async with async_playwright() as p:
22
- browser = await p.chromium.launch()
22
+ browser = await p.chromium.launch(headless=True)
23
+ logger.debug(
24
+ f"Launching headless browser with user agent: {self.headers.get('User-Agent')}"
25
+ )
23
26
  try:
24
27
  context = await browser.new_context(
25
28
  user_agent=self.headers.get('User-Agent')
@@ -29,12 +32,19 @@ class PlayWrightWebContentFetcher(WebFetcherRepository):
29
32
  # Set timeout
30
33
  page.set_default_timeout(self.page_load_timeout * 1000) # Convert to ms
31
34
 
35
+ page.on("console", lambda msg: logger.debug(f"Browser console {url}: {msg.text}"))
36
+
32
37
  # Navigate to the URL
33
- await page.goto(url)
38
+ await page.goto(url, timeout=self.page_load_timeout * 1000, wait_until='domcontentloaded')
34
39
 
35
40
  # Wait for network to be idle if requested
36
41
  if self.wait_for_idle:
37
- await page.wait_for_load_state("networkidle")
42
+ logger.debug(f"Waiting for network idle on {url}")
43
+
44
+ await page.wait_for_load_state("networkidle", timeout=self.page_load_timeout * 1000)
45
+ logger.debug(
46
+ f"Network idle on {url} after {self.page_load_timeout} seconds"
47
+ )
38
48
 
39
49
  logger.debug(f"Successfully fetched {url} with headless browser")
40
50
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: h_ai_brain
3
- Version: 0.0.4
3
+ Version: 0.0.5
4
4
  Summary: AI Research agent API
5
5
  Author-email: shoebill <shoebill.hai@gmail.com>
6
6
  Classifier: Programming Language :: Python :: 3
File without changes
File without changes
File without changes