chatgpt-mirai-qq-bot-web-search 0.2.15__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
- {chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info → chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info}/METADATA +2 -2
- chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/RECORD +11 -0
- web_search/blocks.py +3 -3
- web_search/example/roleplayWithWebSearch.yaml +65 -60
- chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/RECORD +0 -11
- {chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info → chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info}/LICENSE +0 -0
- {chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info → chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info}/WHEEL +0 -0
- {chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info → chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info}/entry_points.txt +0 -0
- {chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info → chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: chatgpt-mirai-qq-bot-web-search
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
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
|
@@ -17,7 +17,7 @@ License-File: LICENSE
|
|
17
17
|
Requires-Dist: playwright
|
18
18
|
Requires-Dist: trafilatura
|
19
19
|
Requires-Dist: lxml-html-clean
|
20
|
-
Requires-Dist: kirara-ai
|
20
|
+
Requires-Dist: kirara-ai>=3.2.0
|
21
21
|
|
22
22
|
# web_search for ChatGPT-Mirai-QQ-Bot
|
23
23
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
web_search/__init__.py,sha256=_vfIxeLqXc53QoZ8sHzw_SbGkxb2CTRQdd1phQmC8GM,6147
|
2
|
+
web_search/blocks.py,sha256=MwOLqQfZKzrepYn8zOvecWtna0PNJmTEEHOr1wM1jT4,9167
|
3
|
+
web_search/config.py,sha256=DhLiERBJR2V5Boglf7Aq9Rbc4vsvLIh67CrLDIPeqA0,398
|
4
|
+
web_search/web_searcher.py,sha256=gYfD0K4_zTIn0pDbB2BABpw7poFuAC4mohJmQWL-3I4,21285
|
5
|
+
web_search/example/roleplayWithWebSearch.yaml,sha256=5KsQ3JHg3J0AlB997Zy337Z2TAZ9hZd4Nsni7sP0BKQ,5188
|
6
|
+
chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/LICENSE,sha256=ILBn-G3jdarm2w8oOrLmXeJNU3czuJvVhDLBASWdhM8,34522
|
7
|
+
chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/METADATA,sha256=95IjyGxiEOuiJuLCu09pPi2qVEa8lGLv8ZPksEPg4tc,1767
|
8
|
+
chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
9
|
+
chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/entry_points.txt,sha256=o3kRDSdSmSdnCKlK6qS57aN0WpI4ab-Nxub2NwUrjf0,64
|
10
|
+
chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/top_level.txt,sha256=PoNm8MJYw_y8RTMaNlY0ePLoNHxVUAE2IHDuL5fFubI,11
|
11
|
+
chatgpt_mirai_qq_bot_web_search-0.3.0.dist-info/RECORD,,
|
web_search/blocks.py
CHANGED
@@ -23,7 +23,7 @@ class WebSearchBlock(Block):
|
|
23
23
|
}
|
24
24
|
|
25
25
|
def __init__(self, name: str = None, max_results: Optional[int] = 3, timeout: Optional[int] = 10, fetch_content: Optional[bool] = True
|
26
|
-
,engine: Annotated[Optional[str],ParamMeta(label="搜索引擎", description="要使用的搜索引擎", options_provider=get_options_provider),] = "
|
26
|
+
,engine: Annotated[Optional[str],ParamMeta(label="搜索引擎", description="要使用的搜索引擎", options_provider=get_options_provider),] = "baidu", proxy: str = None,):
|
27
27
|
super().__init__(name)
|
28
28
|
self.searcher = None
|
29
29
|
self.config = WebSearchConfig()
|
@@ -47,7 +47,7 @@ class WebSearchBlock(Block):
|
|
47
47
|
def execute(self, **kwargs) -> Dict[str, Any]:
|
48
48
|
llmResponse = kwargs["llm_resp"]
|
49
49
|
|
50
|
-
query = llmResponse.
|
50
|
+
query = llmResponse.message.content[0].text if llmResponse.message.content[0].text else ""
|
51
51
|
if query == "" or query.startswith("无"):
|
52
52
|
return {"results": ""}
|
53
53
|
max_results = self.max_results
|
@@ -91,7 +91,7 @@ class WebSearchByKeywordBlock(Block):
|
|
91
91
|
}
|
92
92
|
|
93
93
|
def __init__(self, name: str = None, max_results: Optional[int] = 3, timeout: Optional[int] = 10, fetch_content: Optional[bool] = True
|
94
|
-
,engine: Annotated[Optional[str],ParamMeta(label="搜索引擎", description="要使用的搜索引擎", options_provider=get_options_provider),] = "
|
94
|
+
,engine: Annotated[Optional[str],ParamMeta(label="搜索引擎", description="要使用的搜索引擎", options_provider=get_options_provider),] = "baidu", proxy: str = None,):
|
95
95
|
super().__init__(name)
|
96
96
|
self.searcher = None
|
97
97
|
self.config = WebSearchConfig()
|
@@ -1,4 +1,5 @@
|
|
1
1
|
name: (默认)角色扮演
|
2
|
+
description: ''
|
2
3
|
blocks:
|
3
4
|
- type: internal:toggle_edit_state
|
4
5
|
name: toggle_edit_state_yjxh1a
|
@@ -31,21 +32,6 @@ blocks:
|
|
31
32
|
position:
|
32
33
|
x: 2962
|
33
34
|
y: 306
|
34
|
-
- type: internal:chat_completion
|
35
|
-
name: llm_chat
|
36
|
-
params: {}
|
37
|
-
position:
|
38
|
-
x: 2532
|
39
|
-
y: 138
|
40
|
-
connected_to:
|
41
|
-
- target: chat_response_converter_1q91zd
|
42
|
-
mapping:
|
43
|
-
from: resp
|
44
|
-
to: resp
|
45
|
-
- target: chat_memory_store_nkjr7t
|
46
|
-
mapping:
|
47
|
-
from: resp
|
48
|
-
to: llm_resp
|
49
35
|
- type: internal:get_message
|
50
36
|
name: get_message
|
51
37
|
params: {}
|
@@ -73,49 +59,6 @@ blocks:
|
|
73
59
|
mapping:
|
74
60
|
from: msg
|
75
61
|
to: user_msg
|
76
|
-
- type: internal:text_block
|
77
|
-
name: user_prompt
|
78
|
-
params:
|
79
|
-
text: '{user_name}说:{user_msg}'
|
80
|
-
position:
|
81
|
-
x: 100
|
82
|
-
y: 330
|
83
|
-
connected_to:
|
84
|
-
- target: chat_message_constructor_rafz2d
|
85
|
-
mapping:
|
86
|
-
from: text
|
87
|
-
to: user_prompt_format
|
88
|
-
- target: 5663c818-9cd6-4568-94ec-a75f1bad26cb
|
89
|
-
mapping:
|
90
|
-
from: text
|
91
|
-
to: user_prompt_format
|
92
|
-
- type: internal:chat_memory_query
|
93
|
-
name: query_memory
|
94
|
-
params:
|
95
|
-
scope_type: group
|
96
|
-
position:
|
97
|
-
x: 530
|
98
|
-
y: 338
|
99
|
-
connected_to:
|
100
|
-
- target: chat_message_constructor_rafz2d
|
101
|
-
mapping:
|
102
|
-
from: memory_content
|
103
|
-
to: memory_content
|
104
|
-
- target: 5663c818-9cd6-4568-94ec-a75f1bad26cb
|
105
|
-
mapping:
|
106
|
-
from: memory_content
|
107
|
-
to: memory_content
|
108
|
-
- type: internal:chat_completion
|
109
|
-
name: e3eecc17-e107-4fbf-b8fa-85aef25564c2
|
110
|
-
params: {}
|
111
|
-
position:
|
112
|
-
x: 1337
|
113
|
-
y: 138
|
114
|
-
connected_to:
|
115
|
-
- target: b39e6288-88cf-47a8-9a26-3b4d4f319eab
|
116
|
-
mapping:
|
117
|
-
from: resp
|
118
|
-
to: llm_resp
|
119
62
|
- type: internal:append_systemPrompt
|
120
63
|
name: 309f454b-017a-4d19-b8a9-ac6b3829ff4a
|
121
64
|
params: {}
|
@@ -152,7 +95,7 @@ blocks:
|
|
152
95
|
- type: internal:text_block
|
153
96
|
name: system_prompt
|
154
97
|
params:
|
155
|
-
text:
|
98
|
+
text: ' '
|
156
99
|
position:
|
157
100
|
x: 100
|
158
101
|
y: 530
|
@@ -161,6 +104,66 @@ blocks:
|
|
161
104
|
mapping:
|
162
105
|
from: text
|
163
106
|
to: system_prompt_format
|
107
|
+
- type: internal:chat_memory_query
|
108
|
+
name: query_memory
|
109
|
+
params:
|
110
|
+
scope_type: group
|
111
|
+
position:
|
112
|
+
x: 523
|
113
|
+
y: 336
|
114
|
+
connected_to:
|
115
|
+
- target: chat_message_constructor_rafz2d
|
116
|
+
mapping:
|
117
|
+
from: memory_content
|
118
|
+
to: memory_content
|
119
|
+
- target: 5663c818-9cd6-4568-94ec-a75f1bad26cb
|
120
|
+
mapping:
|
121
|
+
from: memory_content
|
122
|
+
to: memory_content
|
123
|
+
- type: internal:text_block
|
124
|
+
name: user_prompt
|
125
|
+
params:
|
126
|
+
text: '{user_msg}'
|
127
|
+
position:
|
128
|
+
x: 100
|
129
|
+
y: 330
|
130
|
+
connected_to:
|
131
|
+
- target: chat_message_constructor_rafz2d
|
132
|
+
mapping:
|
133
|
+
from: text
|
134
|
+
to: user_prompt_format
|
135
|
+
- target: 5663c818-9cd6-4568-94ec-a75f1bad26cb
|
136
|
+
mapping:
|
137
|
+
from: text
|
138
|
+
to: user_prompt_format
|
139
|
+
- type: internal:chat_completion
|
140
|
+
name: llm_chat
|
141
|
+
params:
|
142
|
+
model_name: gemini-2.0-flash-exp
|
143
|
+
position:
|
144
|
+
x: 2532
|
145
|
+
y: 138
|
146
|
+
connected_to:
|
147
|
+
- target: chat_response_converter_1q91zd
|
148
|
+
mapping:
|
149
|
+
from: resp
|
150
|
+
to: resp
|
151
|
+
- target: chat_memory_store_nkjr7t
|
152
|
+
mapping:
|
153
|
+
from: resp
|
154
|
+
to: llm_resp
|
155
|
+
- type: internal:chat_completion
|
156
|
+
name: e3eecc17-e107-4fbf-b8fa-85aef25564c2
|
157
|
+
params:
|
158
|
+
model_name: gemini-2.0-flash-exp
|
159
|
+
position:
|
160
|
+
x: 1337
|
161
|
+
y: 138
|
162
|
+
connected_to:
|
163
|
+
- target: b39e6288-88cf-47a8-9a26-3b4d4f319eab
|
164
|
+
mapping:
|
165
|
+
from: resp
|
166
|
+
to: llm_resp
|
164
167
|
- type: internal:text_block
|
165
168
|
name: a6db9db3-5780-4d84-8954-eb159a9e8f0a
|
166
169
|
params:
|
@@ -177,8 +180,10 @@ blocks:
|
|
177
180
|
name: b39e6288-88cf-47a8-9a26-3b4d4f319eab
|
178
181
|
params:
|
179
182
|
fetch_content: true
|
180
|
-
max_results:
|
183
|
+
max_results: 1
|
181
184
|
timeout: 10
|
185
|
+
engine: baidu
|
186
|
+
proxy: ''
|
182
187
|
position:
|
183
188
|
x: 1767
|
184
189
|
y: 138
|
@@ -1,11 +0,0 @@
|
|
1
|
-
web_search/__init__.py,sha256=_vfIxeLqXc53QoZ8sHzw_SbGkxb2CTRQdd1phQmC8GM,6147
|
2
|
-
web_search/blocks.py,sha256=QuXt3KMuY4hUW-ucleNYXFvW6YbUAB4Xu4m_SxdCd-U,9152
|
3
|
-
web_search/config.py,sha256=DhLiERBJR2V5Boglf7Aq9Rbc4vsvLIh67CrLDIPeqA0,398
|
4
|
-
web_search/web_searcher.py,sha256=gYfD0K4_zTIn0pDbB2BABpw7poFuAC4mohJmQWL-3I4,21285
|
5
|
-
web_search/example/roleplayWithWebSearch.yaml,sha256=C-dGy3z8gcRcmxzurssP-kPRLqMf1TYR-nnNUaJjISE,7468
|
6
|
-
chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/LICENSE,sha256=ILBn-G3jdarm2w8oOrLmXeJNU3czuJvVhDLBASWdhM8,34522
|
7
|
-
chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/METADATA,sha256=cbaQedDYd6H_4Upgw3Z9TRx8GbXG9ZegvrczHIOWvD4,1767
|
8
|
-
chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
9
|
-
chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/entry_points.txt,sha256=o3kRDSdSmSdnCKlK6qS57aN0WpI4ab-Nxub2NwUrjf0,64
|
10
|
-
chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/top_level.txt,sha256=PoNm8MJYw_y8RTMaNlY0ePLoNHxVUAE2IHDuL5fFubI,11
|
11
|
-
chatgpt_mirai_qq_bot_web_search-0.2.15.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|