chatgpt-mirai-qq-bot-web-search 0.2.15__tar.gz → 0.3.1__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.
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/PKG-INFO +1 -1
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/chatgpt_mirai_qq_bot_web_search.egg-info/PKG-INFO +1 -1
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/chatgpt_mirai_qq_bot_web_search.egg-info/requires.txt +1 -1
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/setup.py +2 -2
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/web_search/blocks.py +6 -9
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/web_search/example/roleplayWithWebSearch.yaml +65 -60
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/LICENSE +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/README.md +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/chatgpt_mirai_qq_bot_web_search.egg-info/SOURCES.txt +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/chatgpt_mirai_qq_bot_web_search.egg-info/dependency_links.txt +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/chatgpt_mirai_qq_bot_web_search.egg-info/entry_points.txt +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/chatgpt_mirai_qq_bot_web_search.egg-info/top_level.txt +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/setup.cfg +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/web_search/__init__.py +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/web_search/config.py +0 -0
- {chatgpt-mirai-qq-bot-web-search-0.2.15 → chatgpt-mirai-qq-bot-web-search-0.3.1}/web_search/web_searcher.py +0 -0
@@ -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.
|
5
|
+
version = os.environ.get('RELEASE_VERSION', '0.3.1'
|
6
6
|
'').lstrip('v')
|
7
7
|
|
8
8
|
setup(
|
@@ -15,7 +15,7 @@ setup(
|
|
15
15
|
},
|
16
16
|
install_requires=[
|
17
17
|
"playwright","trafilatura","lxml_html_clean",
|
18
|
-
"kirara-ai
|
18
|
+
"kirara-ai>=3.2.0",
|
19
19
|
],
|
20
20
|
entry_points={
|
21
21
|
'chatgpt_mirai.plugins': [
|
@@ -3,7 +3,7 @@ import asyncio
|
|
3
3
|
from kirara_ai.workflow.core.block import Block, Input, Output, ParamMeta
|
4
4
|
from .web_searcher import WebSearcher
|
5
5
|
from .config import WebSearchConfig
|
6
|
-
from kirara_ai.llm.format.message import LLMChatMessage
|
6
|
+
from kirara_ai.llm.format.message import LLMChatMessage,LLMToolResultContent
|
7
7
|
from kirara_ai.llm.format.response import LLMChatResponse
|
8
8
|
from kirara_ai.ioc.container import DependencyContainer
|
9
9
|
import re
|
@@ -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()
|
@@ -161,11 +161,8 @@ class AppendSystemPromptBlock(Block):
|
|
161
161
|
def execute(self, **kwargs) -> Dict[str, Any]:
|
162
162
|
results = kwargs["results"]
|
163
163
|
messages: List[LLMChatMessage] = kwargs["messages"]
|
164
|
-
|
165
|
-
|
166
|
-
# 在第一条消息内容后面附加搜索结果
|
167
|
-
messages[0].content = messages[0].content + f"{results}"
|
168
|
-
|
164
|
+
if messages and len(messages) > 0 and results:
|
165
|
+
messages.insert(-2,LLMChatMessage(role = "tool",content=[LLMToolResultContent(content=results,name="工具结果")]))
|
169
166
|
return {"messages": messages}
|
170
167
|
|
171
168
|
class DouyinVideoSearchBlock(Block):
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|