chatgpt-mirai-qq-bot-web-search 0.3.0__py3-none-any.whl → 0.3.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chatgpt-mirai-qq-bot-web-search
3
- Version: 0.3.0
3
+ Version: 0.3.2
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
@@ -1,11 +1,11 @@
1
1
  web_search/__init__.py,sha256=_vfIxeLqXc53QoZ8sHzw_SbGkxb2CTRQdd1phQmC8GM,6147
2
- web_search/blocks.py,sha256=MwOLqQfZKzrepYn8zOvecWtna0PNJmTEEHOr1wM1jT4,9167
2
+ web_search/blocks.py,sha256=r6dPTYmGMCGy4XteQ0rNfSXNAYNHGYEBVnJMDRknUII,9117
3
3
  web_search/config.py,sha256=DhLiERBJR2V5Boglf7Aq9Rbc4vsvLIh67CrLDIPeqA0,398
4
4
  web_search/web_searcher.py,sha256=gYfD0K4_zTIn0pDbB2BABpw7poFuAC4mohJmQWL-3I4,21285
5
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,,
6
+ chatgpt_mirai_qq_bot_web_search-0.3.2.dist-info/LICENSE,sha256=ILBn-G3jdarm2w8oOrLmXeJNU3czuJvVhDLBASWdhM8,34522
7
+ chatgpt_mirai_qq_bot_web_search-0.3.2.dist-info/METADATA,sha256=TcYyooVPC9iPZOl1pyElNc1wm4KvrQwBjve8rScUI5I,1767
8
+ chatgpt_mirai_qq_bot_web_search-0.3.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
9
+ chatgpt_mirai_qq_bot_web_search-0.3.2.dist-info/entry_points.txt,sha256=o3kRDSdSmSdnCKlK6qS57aN0WpI4ab-Nxub2NwUrjf0,64
10
+ chatgpt_mirai_qq_bot_web_search-0.3.2.dist-info/top_level.txt,sha256=PoNm8MJYw_y8RTMaNlY0ePLoNHxVUAE2IHDuL5fFubI,11
11
+ chatgpt_mirai_qq_bot_web_search-0.3.2.dist-info/RECORD,,
web_search/blocks.py CHANGED
@@ -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,LLMChatTextContent
7
7
  from kirara_ai.llm.format.response import LLMChatResponse
8
8
  from kirara_ai.ioc.container import DependencyContainer
9
9
  import re
@@ -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
- if messages and len(messages) > 0 and results and isinstance(messages[0].content,str):
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 = "user",content=[LLMChatTextContent(text=results)]))
169
166
  return {"messages": messages}
170
167
 
171
168
  class DouyinVideoSearchBlock(Block):