AstrBot 4.7.1__py3-none-any.whl → 4.7.3__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.
astrbot/cli/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "3.5.23"
1
+ __version__ = "4.7.3"
@@ -153,6 +153,7 @@ class AssistantMessageSegment(Message):
153
153
  """A message segment from the assistant."""
154
154
 
155
155
  role: Literal["assistant"] = "assistant"
156
+ content: str | list[ContentPart] | None = None
156
157
  tool_calls: list[ToolCall] | list[dict] | None = None
157
158
 
158
159
 
@@ -4,7 +4,7 @@ import os
4
4
 
5
5
  from astrbot.core.utils.astrbot_path import get_astrbot_data_path
6
6
 
7
- VERSION = "4.7.1"
7
+ VERSION = "4.7.3"
8
8
  DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
9
9
 
10
10
  # 默认配置
@@ -90,6 +90,7 @@ DEFAULT_CONFIG = {
90
90
  "group_icl_enable": False,
91
91
  "group_message_max_cnt": 300,
92
92
  "image_caption": False,
93
+ "image_caption_provider_id": "",
93
94
  "active_reply": {
94
95
  "enable": False,
95
96
  "method": "possibility_reply",
@@ -2109,6 +2110,9 @@ CONFIG_METADATA_2 = {
2109
2110
  "image_caption": {
2110
2111
  "type": "bool",
2111
2112
  },
2113
+ "image_caption_provider_id": {
2114
+ "type": "string",
2115
+ },
2112
2116
  "image_caption_prompt": {
2113
2117
  "type": "string",
2114
2118
  },
@@ -2785,7 +2789,16 @@ CONFIG_METADATA_3 = {
2785
2789
  "provider_ltm_settings.image_caption": {
2786
2790
  "description": "自动理解图片",
2787
2791
  "type": "bool",
2788
- "hint": "需要设置默认图片转述模型。",
2792
+ "hint": "需要设置群聊图片转述模型。",
2793
+ },
2794
+ "provider_ltm_settings.image_caption_provider_id": {
2795
+ "description": "群聊图片转述模型",
2796
+ "type": "string",
2797
+ "_special": "select_provider",
2798
+ "hint": "用于群聊上下文感知的图片理解,与默认图片转述模型分开配置。",
2799
+ "condition": {
2800
+ "provider_ltm_settings.image_caption": True,
2801
+ },
2789
2802
  },
2790
2803
  "provider_ltm_settings.active_reply.enable": {
2791
2804
  "description": "主动回复",
@@ -2,7 +2,7 @@ import asyncio
2
2
  from collections.abc import AsyncGenerator
3
3
  from typing import TYPE_CHECKING
4
4
 
5
- from astrbot.core import logger
5
+ from astrbot.core import astrbot_config, logger
6
6
  from astrbot.core.agent.runners.coze.coze_agent_runner import CozeAgentRunner
7
7
  from astrbot.core.agent.runners.dashscope.dashscope_agent_runner import (
8
8
  DashscopeAgentRunner,
@@ -88,12 +88,15 @@ class ThirdPartyAgentSubStage(Stage):
88
88
  return
89
89
 
90
90
  self.prov_cfg: dict = next(
91
- (p for p in self.conf["provider"] if p["id"] == self.prov_id),
91
+ (p for p in astrbot_config["provider"] if p["id"] == self.prov_id),
92
92
  {},
93
93
  )
94
- if not self.prov_id or not self.prov_cfg:
94
+ if not self.prov_id:
95
+ logger.error("没有填写 Agent Runner 提供商 ID,请前往配置页面配置。")
96
+ return
97
+ if not self.prov_cfg:
95
98
  logger.error(
96
- "Third Party Agent Runner provider ID is not configured properly."
99
+ f"Agent Runner 提供商 {self.prov_id} 配置不存在,请前往配置页面修改配置。"
97
100
  )
98
101
  return
99
102
 
@@ -1,6 +1,5 @@
1
1
  from collections.abc import AsyncGenerator
2
2
 
3
- from astrbot.core import logger
4
3
  from astrbot.core.platform.astr_message_event import AstrMessageEvent
5
4
  from astrbot.core.provider.entities import ProviderRequest
6
5
  from astrbot.core.star.star_handler import StarHandlerMetadata
@@ -63,12 +62,5 @@ class ProcessStage(Stage):
63
62
  if (
64
63
  event.get_result() and not event.get_result().is_stopped()
65
64
  ) or not event.get_result():
66
- # 事件没有终止传播
67
- provider = self.ctx.plugin_manager.context.get_using_provider()
68
-
69
- if not provider:
70
- logger.info("未找到可用的 LLM 提供商,请先前往配置服务提供商。")
71
- return
72
-
73
65
  async for _ in self.agent_sub_stage.process(event):
74
66
  yield
@@ -290,7 +290,7 @@ class ProviderAnthropic(Provider):
290
290
  try:
291
291
  llm_response = await self._query(payloads, func_tool)
292
292
  except Exception as e:
293
- logger.error(f"发生了错误。Provider 配置如下: {model_config}")
293
+ # logger.error(f"发生了错误。Provider 配置如下: {model_config}")
294
294
  raise e
295
295
 
296
296
  return llm_response
@@ -111,9 +111,9 @@ class ProviderGoogleGenAI(Provider):
111
111
  f"检测到 Key 异常({e.message}),且已没有可用的 Key。 当前 Key: {self.chosen_api_key[:12]}...",
112
112
  )
113
113
  raise Exception("达到了 Gemini 速率限制, 请稍后再试...")
114
- logger.error(
115
- f"发生了错误(gemini_source)。Provider 配置如下: {self.provider_config}",
116
- )
114
+ # logger.error(
115
+ # f"发生了错误(gemini_source)。Provider 配置如下: {self.provider_config}",
116
+ # )
117
117
  raise e
118
118
 
119
119
  async def _prepare_query_config(
@@ -433,7 +433,7 @@ class ProviderOpenAIOfficial(Provider):
433
433
  )
434
434
  payloads.pop("tools", None)
435
435
  return False, chosen_key, available_api_keys, payloads, context_query, None
436
- logger.error(f"发生了错误。Provider 配置如下: {self.provider_config}")
436
+ # logger.error(f"发生了错误。Provider 配置如下: {self.provider_config}")
437
437
 
438
438
  if "tool" in str(e).lower() and "support" in str(e).lower():
439
439
  logger.error("疑似该模型不支持函数调用工具调用。请输入 /tool off_all")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AstrBot
3
- Version: 4.7.1
3
+ Version: 4.7.3
4
4
  Summary: Easy-to-use multi-platform LLM chatbot and development framework
5
5
  License-File: LICENSE
6
6
  Keywords: Astrbot,Astrbot Module,Astrbot Plugin
@@ -8,7 +8,7 @@ astrbot/api/platform/__init__.py,sha256=HXvAy_KLtOJspoGVgDtLa7VjIZoF6WK3Puww55yy
8
8
  astrbot/api/provider/__init__.py,sha256=mJVcon0snjn_xYirk2hntwba6ymIYYC-ZKKmxvx-jok,379
9
9
  astrbot/api/star/__init__.py,sha256=OxgHGtWn3lEQGjb4twbpbWnRepUevPu7gxtDAkAsfhQ,250
10
10
  astrbot/api/util/__init__.py,sha256=L1O_mFEUDk8V4lEPsT5iiNbIiOVh7HbrNmitqzUWMZg,180
11
- astrbot/cli/__init__.py,sha256=b5kXc-KWXgh_CEs-Gwrxdta2EjaWkLB9RgvwamG7L4g,23
11
+ astrbot/cli/__init__.py,sha256=AVNyT1NGAIO5hXAir4yWNPjObYD-xdsUWAPTcyEnMD0,22
12
12
  astrbot/cli/__main__.py,sha256=QobgMyFoLNTgI_OYddhGOZ9ZvQeBVjjz79mA2cC2OEU,1758
13
13
  astrbot/cli/commands/__init__.py,sha256=eAgppZQIqFO1ylQJFABeYrzQ0oZqPWjtE80aKIPB3ks,149
14
14
  astrbot/cli/commands/cmd_conf.py,sha256=6-YLicBt_zjWTzaVLUJ1VQLQPbDEPYACB9IVnN8Zvng,6330
@@ -41,7 +41,7 @@ astrbot/core/agent/agent.py,sha256=wquvKo18JcsJM56dwKyFFAoGhc5qLyQaeqdZ-LlZsWQ,3
41
41
  astrbot/core/agent/handoff.py,sha256=AxO0yx4Uscy0CO-3Q3fvDOfpfr3gUscLRplH7gH7-Lc,1194
42
42
  astrbot/core/agent/hooks.py,sha256=ooe9uUz7czlVt2W7jTDwkRbI-qDrOOXWjCaXtiAkrvE,830
43
43
  astrbot/core/agent/mcp_client.py,sha256=u52GPgpeZ1DCCVbI6x4kOGyodD_kweB8H1OgaVg-BZs,14085
44
- astrbot/core/agent/message.py,sha256=kKVCGCGmbNENlWitTCGycos6uNRPuDys5jecOJDsuWQ,5336
44
+ astrbot/core/agent/message.py,sha256=HqOuk6PTbuCZaMz4O5vr-BOYvfISoG5YujMejW78klc,5387
45
45
  astrbot/core/agent/response.py,sha256=ddJABXu03Uw3b-YGTvRafFLJEGa40o93pIEz_CRTb4g,261
46
46
  astrbot/core/agent/run_context.py,sha256=h-teucYKYi5o4oTbAsIlkaa04yn2OSNC-ahIF2n6cwE,719
47
47
  astrbot/core/agent/tool.py,sha256=3F-zcADIJkACNljrlDJBZZCJwqhxFkfpgoKvg5v0TQM,9276
@@ -56,7 +56,7 @@ astrbot/core/agent/runners/dify/dify_agent_runner.py,sha256=LYwpjOcBWf3XlwNVzrDv
56
56
  astrbot/core/agent/runners/dify/dify_api_client.py,sha256=OXukDVgNx3VmYw6OCzjXyP8JmDWEFuy81sD9XnC4VRo,6530
57
57
  astrbot/core/config/__init__.py,sha256=vZjtpC7vr-IvBgSUtbS04C0wpulmCG5tPmcEP1WYE_4,172
58
58
  astrbot/core/config/astrbot_config.py,sha256=nGyvHyR9VJH9Pk0XKYyeDFVxjwbyVb9u0lIsuvpe3fg,6276
59
- astrbot/core/config/default.py,sha256=3tipwUYSFBELGH2iXQRk3-SNjhCWrR-n_yVcnhIntJw,142988
59
+ astrbot/core/config/default.py,sha256=E5_DXdDvwf835zGmAvcBLTOiH5Z42fzBd6SrC8T6yrE,143667
60
60
  astrbot/core/config/i18n_utils.py,sha256=T2uLmhx1nohJIou14QQBjb2TSvdxDxtfUjVHpwy13z0,3841
61
61
  astrbot/core/db/__init__.py,sha256=s4oIWazGk2U1-9dkr3bvq8M4g9nwOXy4e3f53zlvAJk,10326
62
62
  astrbot/core/db/po.py,sha256=zFv5eU4tuM6E4ehGzugHnszWl6VBpS_rcD9IjjjkhXE,9398
@@ -107,12 +107,12 @@ astrbot/core/pipeline/content_safety_check/strategies/baidu_aip.py,sha256=-DvF8O
107
107
  astrbot/core/pipeline/content_safety_check/strategies/keywords.py,sha256=N3bR19Deb3a-DOE-3hiuogsC068uYNL25fCe9BVkKKA,905
108
108
  astrbot/core/pipeline/content_safety_check/strategies/strategy.py,sha256=XM2c-6apssEtAllMAI6BUXaEN_t2XINHcCoAudeKNwc,1206
109
109
  astrbot/core/pipeline/preprocess_stage/stage.py,sha256=BFaON3u4MrQUXp0ZXETU5MIvN_w0p0KJDNc9D7Y3qsY,4202
110
- astrbot/core/pipeline/process_stage/stage.py,sha256=DC0rrGXBvBRQNMnRc0A9DzfHmvP_ycg7s1fuMKKt6cQ,2743
110
+ astrbot/core/pipeline/process_stage/stage.py,sha256=J01Xg8sNFFGU4Z6dZy6jJcQnwXfdop0X8hnwdb_DwEs,2419
111
111
  astrbot/core/pipeline/process_stage/utils.py,sha256=q4V5G0PZD5b5mPh1lM-6w79LKGpp7RR7-PqYFhWpopM,4061
112
112
  astrbot/core/pipeline/process_stage/method/agent_request.py,sha256=GlGrGCsCASC4a3PpG6Oc1907aLdl_PrUMXrFiEiEEzc,2043
113
113
  astrbot/core/pipeline/process_stage/method/star_request.py,sha256=icx3zkXLHDtX4SU5soe0UiOLgJjYW6ehoSBpMYSEE8U,2508
114
114
  astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py,sha256=ntW4aBAzMrzuquGuR2lLkneZ5X4j28yrOBDbVKWF7Ns,18686
115
- astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py,sha256=a4lRpTQj3KYFZ5ZwZtRAMmSDptymXBdd-wMl1e2drz4,7151
115
+ astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py,sha256=Cr5isDXIaL4oFlkt2Mr6UuijPNfp_RjC6RiTtwuSpfg,7329
116
116
  astrbot/core/pipeline/rate_limit_check/stage.py,sha256=9EVJ0zYtxATFsj7ADyWDYcSGBRqmrMiKWp1kkD9LONI,3962
117
117
  astrbot/core/pipeline/respond/stage.py,sha256=im_UrME-g-YOk9TnrDFzFeYIvzZsGBy9BDCAp5PXuNM,10738
118
118
  astrbot/core/pipeline/result_decorate/stage.py,sha256=RF5YGPmH7aOUk_PcBg8lJ_Dz9-lPjgikekT5IdyLj-8,14626
@@ -182,21 +182,21 @@ astrbot/core/provider/func_tool_manager.py,sha256=28fOKbpWOxiclwfcNkmP6sHSBlK4cZ
182
182
  astrbot/core/provider/manager.py,sha256=_nXzEqWrOnIq-O845ECMJ79ez0TKQGzVJtRoYX8lCdo,22902
183
183
  astrbot/core/provider/provider.py,sha256=bMJBBZzNwHhVv8dEiO1tNUclzxS78Yb01vUbceHZXKA,10680
184
184
  astrbot/core/provider/register.py,sha256=0WMYrT9vbRjeq-72HD0oRT45kJmeKA96UgSItpTJbX8,1904
185
- astrbot/core/provider/sources/anthropic_source.py,sha256=kRbJk0K-li84mWwapxYezGlkEF03Lg1brZDZnjmGrQ8,15584
185
+ astrbot/core/provider/sources/anthropic_source.py,sha256=oSd7I8pCGwrmTKMQuxVza0vRNqgQw7nqhMxuZnc9ro0,15586
186
186
  astrbot/core/provider/sources/azure_tts_source.py,sha256=uhPr4Dja6XANesAmrfZiuINNIlXej0NV7Goo8ahMm14,9387
187
187
  astrbot/core/provider/sources/bailian_rerank_source.py,sha256=-kxF2XRnQRikGggymOBS2aJHRi8Y-zZgc4ykmred9UQ,7451
188
188
  astrbot/core/provider/sources/dashscope_tts.py,sha256=GMslnWn9e30c78qHhnMioJrG60nAwSWo3nXsQmISJno,5603
189
189
  astrbot/core/provider/sources/edge_tts_source.py,sha256=7C04B0voPmQdeaB4u-U5Lip6qN3UAyB_yNPBYHLaxo8,4680
190
190
  astrbot/core/provider/sources/fishaudio_tts_api_source.py,sha256=P2N_dkwxx3Kk1uWae1TT4yJShj6i0Q_jTpWT1V_dLQ0,5484
191
191
  astrbot/core/provider/sources/gemini_embedding_source.py,sha256=XpTqb5rlI5z34FmrdFkpvwkk9BiuyFKcpWm6xQEHpNE,2248
192
- astrbot/core/provider/sources/gemini_source.py,sha256=msWhkuvNw4BD7-Y-HPkcNj7DZBmlxOLSK7XESB54JEI,31322
192
+ astrbot/core/provider/sources/gemini_source.py,sha256=uUtQozqVv2JNaqt9K7MwKHONRIy4VVxwA2J1ZyFKNMY,31328
193
193
  astrbot/core/provider/sources/gemini_tts_source.py,sha256=6LJIT2aTjoZaMszjYRzDu38prsO9G5Xg7SzJmQb2TzE,2880
194
194
  astrbot/core/provider/sources/groq_source.py,sha256=NqmiQn37mrMsaTyGX25eNzMpIgkCifY-5TJO8DFzHaA,456
195
195
  astrbot/core/provider/sources/gsv_selfhosted_source.py,sha256=RYQgwCc67N7RWPaODN4sSLJZn6o5gpgk_jF_KaRnD0M,5942
196
196
  astrbot/core/provider/sources/gsvi_tts_source.py,sha256=nGGctfkzrAeTofAvB2b_VNTYHW44SzyO12B-mBWb1rY,2011
197
197
  astrbot/core/provider/sources/minimax_tts_api_source.py,sha256=qMN6iBR2V145d5BAIkjAa2pVrH5eZOHeWnd8yhemOCY,5837
198
198
  astrbot/core/provider/sources/openai_embedding_source.py,sha256=26hjOYrQ8eHHPi8wybCubtsY-UOOfGx0qcCxQ3BvjIE,1616
199
- astrbot/core/provider/sources/openai_source.py,sha256=FU1xEYkoRZrc-AB6Hf6I4iHU8nbl22k0i5nhHxAKAuw,24275
199
+ astrbot/core/provider/sources/openai_source.py,sha256=LAP2agr6_-ZmoxVuofTuTAw5p6zapaNZTlMA5prafgc,24277
200
200
  astrbot/core/provider/sources/openai_tts_api_source.py,sha256=DVviGQdBpCk6lW3LjnJHzwZr9wGkXRDNwfoQ3FYFVcs,1667
201
201
  astrbot/core/provider/sources/sensevoice_selfhosted_source.py,sha256=aG7m3HvqSdcTRJcncqFNhyz9D-TVIdjiCbGFQPhDcdM,3819
202
202
  astrbot/core/provider/sources/vllm_rerank_source.py,sha256=5mZwtOUG1w7AfqQR7AYznxL_L0HVOKq6_T2G0CrNkZg,2316
@@ -267,8 +267,8 @@ astrbot/dashboard/routes/static_file.py,sha256=7KnNcOb1BVqSTft114LhGsDkfg69X2jHE
267
267
  astrbot/dashboard/routes/t2i.py,sha256=F6smxdL99MF7cRw3hqS6-2GErw8Zhsv0V0mfBUeEk-c,8931
268
268
  astrbot/dashboard/routes/tools.py,sha256=YsVFrwVIhxAI-Ikme7YPrHVnPVTkJ1IaH7n6ciREjdE,14663
269
269
  astrbot/dashboard/routes/update.py,sha256=qXiqQ_dbqRVftOzGgCQrvK8-qopVK6zKhhVVJ9SK26U,6648
270
- astrbot-4.7.1.dist-info/METADATA,sha256=7VCintJ9fcOvWXwadmXR1TKiW0AZ0s6ecwmVXPBNvqY,10370
271
- astrbot-4.7.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
272
- astrbot-4.7.1.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
273
- astrbot-4.7.1.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
274
- astrbot-4.7.1.dist-info/RECORD,,
270
+ astrbot-4.7.3.dist-info/METADATA,sha256=bo07BXGbFtONTjCZoigfHCXHHlN0OwJtb_19iZyG6Cc,10370
271
+ astrbot-4.7.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
272
+ astrbot-4.7.3.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
273
+ astrbot-4.7.3.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
274
+ astrbot-4.7.3.dist-info/RECORD,,