chatgpt-mirai-qq-bot-web-search 0.1.8__tar.gz → 0.1.10__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 (16) hide show
  1. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/PKG-INFO +3 -16
  2. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/README.md +1 -1
  3. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/chatgpt_mirai_qq_bot_web_search.egg-info/PKG-INFO +3 -16
  4. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/setup.py +1 -1
  5. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/web_search/__init__.py +31 -12
  6. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/LICENSE +0 -0
  7. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/chatgpt_mirai_qq_bot_web_search.egg-info/SOURCES.txt +0 -0
  8. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/chatgpt_mirai_qq_bot_web_search.egg-info/dependency_links.txt +0 -0
  9. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/chatgpt_mirai_qq_bot_web_search.egg-info/entry_points.txt +0 -0
  10. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/chatgpt_mirai_qq_bot_web_search.egg-info/requires.txt +0 -0
  11. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/chatgpt_mirai_qq_bot_web_search.egg-info/top_level.txt +0 -0
  12. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/setup.cfg +0 -0
  13. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/web_search/blocks.py +0 -0
  14. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/web_search/config.py +0 -0
  15. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/web_search/example/roleplayWithWebSearch.yaml +0 -0
  16. {chatgpt_mirai_qq_bot_web_search-0.1.8 → chatgpt-mirai-qq-bot-web-search-0.1.10}/web_search/web_searcher.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.1
2
2
  Name: chatgpt-mirai-qq-bot-web-search
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: WebSearch adapter for lss233/chatgpt-mirai-qq-bot
5
5
  Home-page: https://github.com/chuanSir123/web_search
6
6
  Author: chuanSir
@@ -14,19 +14,6 @@ Classifier: Operating System :: OS Independent
14
14
  Requires-Python: >=3.8
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: playwright
18
- Requires-Dist: trafilatura
19
- Requires-Dist: lxml_html_clean
20
- Dynamic: author
21
- Dynamic: author-email
22
- Dynamic: classifier
23
- Dynamic: description
24
- Dynamic: description-content-type
25
- Dynamic: home-page
26
- Dynamic: project-url
27
- Dynamic: requires-dist
28
- Dynamic: requires-python
29
- Dynamic: summary
30
17
 
31
18
  # OneBot-adapter for ChatGPT-Mirai-QQ-Bot
32
19
 
@@ -41,7 +28,7 @@ pip install chatgpt-mirai-qq-bot-web-search
41
28
  ## 使用
42
29
 
43
30
  在 chatgpt-mirai-qq-bot的web_ui中配置
44
- 使用示例请参考 [web_search/example/normal.yml](web_search/example/roleplayWithWebSearch.yaml)
31
+ 使用示例请参考 [web_search/example/roleplayWithWebSearch.yml](web_search/example/roleplayWithWebSearch.yaml)
45
32
  工作流请参考 [示例图片](web_search/example/workflow.png)
46
33
 
47
34
  ## 开源协议
@@ -11,7 +11,7 @@ pip install chatgpt-mirai-qq-bot-web-search
11
11
  ## 使用
12
12
 
13
13
  在 chatgpt-mirai-qq-bot的web_ui中配置
14
- 使用示例请参考 [web_search/example/normal.yml](web_search/example/roleplayWithWebSearch.yaml)
14
+ 使用示例请参考 [web_search/example/roleplayWithWebSearch.yml](web_search/example/roleplayWithWebSearch.yaml)
15
15
  工作流请参考 [示例图片](web_search/example/workflow.png)
16
16
 
17
17
  ## 开源协议
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.1
2
2
  Name: chatgpt-mirai-qq-bot-web-search
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: WebSearch adapter for lss233/chatgpt-mirai-qq-bot
5
5
  Home-page: https://github.com/chuanSir123/web_search
6
6
  Author: chuanSir
@@ -14,19 +14,6 @@ Classifier: Operating System :: OS Independent
14
14
  Requires-Python: >=3.8
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: playwright
18
- Requires-Dist: trafilatura
19
- Requires-Dist: lxml_html_clean
20
- Dynamic: author
21
- Dynamic: author-email
22
- Dynamic: classifier
23
- Dynamic: description
24
- Dynamic: description-content-type
25
- Dynamic: home-page
26
- Dynamic: project-url
27
- Dynamic: requires-dist
28
- Dynamic: requires-python
29
- Dynamic: summary
30
17
 
31
18
  # OneBot-adapter for ChatGPT-Mirai-QQ-Bot
32
19
 
@@ -41,7 +28,7 @@ pip install chatgpt-mirai-qq-bot-web-search
41
28
  ## 使用
42
29
 
43
30
  在 chatgpt-mirai-qq-bot的web_ui中配置
44
- 使用示例请参考 [web_search/example/normal.yml](web_search/example/roleplayWithWebSearch.yaml)
31
+ 使用示例请参考 [web_search/example/roleplayWithWebSearch.yml](web_search/example/roleplayWithWebSearch.yaml)
45
32
  工作流请参考 [示例图片](web_search/example/workflow.png)
46
33
 
47
34
  ## 开源协议
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
  import io
3
3
  import os
4
4
 
5
- version = os.environ.get('RELEASE_VERSION', '0.1.8'
5
+ version = os.environ.get('RELEASE_VERSION', '0.1.10'
6
6
  '').lstrip('v')
7
7
 
8
8
  setup(
@@ -36,21 +36,40 @@ class WebSearchPlugin(Plugin):
36
36
  self.block_registry.register("append_systemPrompt", "internal", AppendSystemPromptBlock)
37
37
  except Exception as e:
38
38
  logger.warning(f"WebSearchPlugin failed: {e}")
39
- # 获取当前文件的绝对路径
40
- with importlib.resources.path('web_search', '__init__.py') as p:
41
- package_path = p.parent
42
- example_dir = package_path / 'example'
39
+ try:
40
+ # 获取当前文件的绝对路径
41
+ with importlib.resources.path('web_search', '__init__.py') as p:
42
+ package_path = p.parent
43
+ example_dir = package_path / 'example'
44
+
45
+ # 确保目录存在
46
+ if not example_dir.exists():
47
+ raise FileNotFoundError(f"Example directory not found at {example_dir}")
48
+
49
+ # 获取所有yaml文件
50
+ yaml_files = list(example_dir.glob('*.yaml')) + list(example_dir.glob('*.yml'))
51
+
52
+ for yaml in yaml_files:
53
+ logger.info(yaml)
54
+ self.workflow_registry.register("chat", yaml.stem, WorkflowBuilder.load_from_yaml(os.path.join(example_dir, yaml), self.container))
55
+ except Exception as e:
56
+ try:
57
+ current_file = os.path.abspath(__file__)
58
+
59
+ # 获取当前文件所在目录
60
+ parent_dir = os.path.dirname(current_file)
43
61
 
44
- # 确保目录存在
45
- if not example_dir.exists():
46
- raise FileNotFoundError(f"Example directory not found at {example_dir}")
62
+ # 构建 example 目录的路径
63
+ example_dir = os.path.join(parent_dir, 'example')
64
+ # 获取 example 目录下所有的 yaml 文件
65
+ yaml_files = [f for f in os.listdir(example_dir) if f.endswith('.yaml') or f.endswith('.yml')]
47
66
 
48
- # 获取所有yaml文件
49
- yaml_files = list(example_dir.glob('*.yaml')) + list(example_dir.glob('*.yml'))
67
+ for yaml in yaml_files:
68
+ logger.info(os.path.join(example_dir, yaml))
69
+ self.workflow_registry.register("search", "roleplayWithWebSearch", WorkflowBuilder.load_from_yaml(os.path.join(example_dir, yaml), self.container))
70
+ except Exception as e:
71
+ logger.warning(f"workflow_registry failed: {e}")
50
72
 
51
- for yaml in yaml_files:
52
- logger.info(yaml)
53
- self.workflow_registry.register("chat", yaml.stem, WorkflowBuilder.load_from_yaml(os.path.join(example_dir, yaml), self.container))
54
73
  @dataclass
55
74
  class WebSearchEvent:
56
75
  """Web搜索事件"""