AstrBot 3.5.6__py3-none-any.whl → 4.7.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.
- astrbot/api/__init__.py +16 -4
- astrbot/api/all.py +2 -1
- astrbot/api/event/__init__.py +5 -6
- astrbot/api/event/filter/__init__.py +37 -34
- astrbot/api/platform/__init__.py +7 -8
- astrbot/api/provider/__init__.py +8 -7
- astrbot/api/star/__init__.py +3 -4
- astrbot/api/util/__init__.py +2 -2
- astrbot/cli/__init__.py +1 -0
- astrbot/cli/__main__.py +18 -197
- astrbot/cli/commands/__init__.py +6 -0
- astrbot/cli/commands/cmd_conf.py +209 -0
- astrbot/cli/commands/cmd_init.py +56 -0
- astrbot/cli/commands/cmd_plug.py +245 -0
- astrbot/cli/commands/cmd_run.py +62 -0
- astrbot/cli/utils/__init__.py +18 -0
- astrbot/cli/utils/basic.py +76 -0
- astrbot/cli/utils/plugin.py +246 -0
- astrbot/cli/utils/version_comparator.py +90 -0
- astrbot/core/__init__.py +17 -19
- astrbot/core/agent/agent.py +14 -0
- astrbot/core/agent/handoff.py +38 -0
- astrbot/core/agent/hooks.py +30 -0
- astrbot/core/agent/mcp_client.py +385 -0
- astrbot/core/agent/message.py +175 -0
- astrbot/core/agent/response.py +14 -0
- astrbot/core/agent/run_context.py +22 -0
- astrbot/core/agent/runners/__init__.py +3 -0
- astrbot/core/agent/runners/base.py +65 -0
- astrbot/core/agent/runners/coze/coze_agent_runner.py +367 -0
- astrbot/core/agent/runners/coze/coze_api_client.py +324 -0
- astrbot/core/agent/runners/dashscope/dashscope_agent_runner.py +403 -0
- astrbot/core/agent/runners/dify/dify_agent_runner.py +336 -0
- astrbot/core/agent/runners/dify/dify_api_client.py +195 -0
- astrbot/core/agent/runners/tool_loop_agent_runner.py +400 -0
- astrbot/core/agent/tool.py +285 -0
- astrbot/core/agent/tool_executor.py +17 -0
- astrbot/core/astr_agent_context.py +19 -0
- astrbot/core/astr_agent_hooks.py +36 -0
- astrbot/core/astr_agent_run_util.py +80 -0
- astrbot/core/astr_agent_tool_exec.py +246 -0
- astrbot/core/astrbot_config_mgr.py +275 -0
- astrbot/core/config/__init__.py +2 -2
- astrbot/core/config/astrbot_config.py +60 -20
- astrbot/core/config/default.py +1972 -453
- astrbot/core/config/i18n_utils.py +110 -0
- astrbot/core/conversation_mgr.py +285 -75
- astrbot/core/core_lifecycle.py +167 -62
- astrbot/core/db/__init__.py +305 -102
- astrbot/core/db/migration/helper.py +69 -0
- astrbot/core/db/migration/migra_3_to_4.py +357 -0
- astrbot/core/db/migration/migra_45_to_46.py +44 -0
- astrbot/core/db/migration/migra_webchat_session.py +131 -0
- astrbot/core/db/migration/shared_preferences_v3.py +48 -0
- astrbot/core/db/migration/sqlite_v3.py +497 -0
- astrbot/core/db/po.py +259 -55
- astrbot/core/db/sqlite.py +773 -528
- astrbot/core/db/vec_db/base.py +73 -0
- astrbot/core/db/vec_db/faiss_impl/__init__.py +3 -0
- astrbot/core/db/vec_db/faiss_impl/document_storage.py +392 -0
- astrbot/core/db/vec_db/faiss_impl/embedding_storage.py +93 -0
- astrbot/core/db/vec_db/faiss_impl/sqlite_init.sql +17 -0
- astrbot/core/db/vec_db/faiss_impl/vec_db.py +204 -0
- astrbot/core/event_bus.py +26 -22
- astrbot/core/exceptions.py +9 -0
- astrbot/core/file_token_service.py +98 -0
- astrbot/core/initial_loader.py +19 -10
- astrbot/core/knowledge_base/chunking/__init__.py +9 -0
- astrbot/core/knowledge_base/chunking/base.py +25 -0
- astrbot/core/knowledge_base/chunking/fixed_size.py +59 -0
- astrbot/core/knowledge_base/chunking/recursive.py +161 -0
- astrbot/core/knowledge_base/kb_db_sqlite.py +301 -0
- astrbot/core/knowledge_base/kb_helper.py +642 -0
- astrbot/core/knowledge_base/kb_mgr.py +330 -0
- astrbot/core/knowledge_base/models.py +120 -0
- astrbot/core/knowledge_base/parsers/__init__.py +13 -0
- astrbot/core/knowledge_base/parsers/base.py +51 -0
- astrbot/core/knowledge_base/parsers/markitdown_parser.py +26 -0
- astrbot/core/knowledge_base/parsers/pdf_parser.py +101 -0
- astrbot/core/knowledge_base/parsers/text_parser.py +42 -0
- astrbot/core/knowledge_base/parsers/url_parser.py +103 -0
- astrbot/core/knowledge_base/parsers/util.py +13 -0
- astrbot/core/knowledge_base/prompts.py +65 -0
- astrbot/core/knowledge_base/retrieval/__init__.py +14 -0
- astrbot/core/knowledge_base/retrieval/hit_stopwords.txt +767 -0
- astrbot/core/knowledge_base/retrieval/manager.py +276 -0
- astrbot/core/knowledge_base/retrieval/rank_fusion.py +142 -0
- astrbot/core/knowledge_base/retrieval/sparse_retriever.py +136 -0
- astrbot/core/log.py +21 -15
- astrbot/core/message/components.py +413 -287
- astrbot/core/message/message_event_result.py +35 -24
- astrbot/core/persona_mgr.py +192 -0
- astrbot/core/pipeline/__init__.py +14 -14
- astrbot/core/pipeline/content_safety_check/stage.py +13 -9
- astrbot/core/pipeline/content_safety_check/strategies/__init__.py +1 -2
- astrbot/core/pipeline/content_safety_check/strategies/baidu_aip.py +13 -14
- astrbot/core/pipeline/content_safety_check/strategies/keywords.py +2 -1
- astrbot/core/pipeline/content_safety_check/strategies/strategy.py +6 -6
- astrbot/core/pipeline/context.py +7 -1
- astrbot/core/pipeline/context_utils.py +107 -0
- astrbot/core/pipeline/preprocess_stage/stage.py +63 -36
- astrbot/core/pipeline/process_stage/method/agent_request.py +48 -0
- astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py +464 -0
- astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py +202 -0
- astrbot/core/pipeline/process_stage/method/star_request.py +26 -32
- astrbot/core/pipeline/process_stage/stage.py +21 -15
- astrbot/core/pipeline/process_stage/utils.py +125 -0
- astrbot/core/pipeline/rate_limit_check/stage.py +34 -36
- astrbot/core/pipeline/respond/stage.py +142 -101
- astrbot/core/pipeline/result_decorate/stage.py +124 -57
- astrbot/core/pipeline/scheduler.py +21 -16
- astrbot/core/pipeline/session_status_check/stage.py +37 -0
- astrbot/core/pipeline/stage.py +11 -76
- astrbot/core/pipeline/waking_check/stage.py +69 -33
- astrbot/core/pipeline/whitelist_check/stage.py +10 -7
- astrbot/core/platform/__init__.py +6 -6
- astrbot/core/platform/astr_message_event.py +107 -129
- astrbot/core/platform/astrbot_message.py +32 -12
- astrbot/core/platform/manager.py +62 -18
- astrbot/core/platform/message_session.py +30 -0
- astrbot/core/platform/platform.py +16 -24
- astrbot/core/platform/platform_metadata.py +9 -4
- astrbot/core/platform/register.py +12 -7
- astrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py +136 -60
- astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +126 -46
- astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py +63 -31
- astrbot/core/platform/sources/dingtalk/dingtalk_event.py +30 -26
- astrbot/core/platform/sources/discord/client.py +129 -0
- astrbot/core/platform/sources/discord/components.py +139 -0
- astrbot/core/platform/sources/discord/discord_platform_adapter.py +473 -0
- astrbot/core/platform/sources/discord/discord_platform_event.py +313 -0
- astrbot/core/platform/sources/lark/lark_adapter.py +27 -18
- astrbot/core/platform/sources/lark/lark_event.py +39 -13
- astrbot/core/platform/sources/misskey/misskey_adapter.py +770 -0
- astrbot/core/platform/sources/misskey/misskey_api.py +964 -0
- astrbot/core/platform/sources/misskey/misskey_event.py +163 -0
- astrbot/core/platform/sources/misskey/misskey_utils.py +550 -0
- astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +149 -33
- astrbot/core/platform/sources/qqofficial/qqofficial_platform_adapter.py +41 -26
- astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_adapter.py +36 -17
- astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_event.py +3 -1
- astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py +14 -8
- astrbot/core/platform/sources/satori/satori_adapter.py +792 -0
- astrbot/core/platform/sources/satori/satori_event.py +432 -0
- astrbot/core/platform/sources/slack/client.py +164 -0
- astrbot/core/platform/sources/slack/slack_adapter.py +416 -0
- astrbot/core/platform/sources/slack/slack_event.py +253 -0
- astrbot/core/platform/sources/telegram/tg_adapter.py +100 -43
- astrbot/core/platform/sources/telegram/tg_event.py +136 -36
- astrbot/core/platform/sources/webchat/webchat_adapter.py +72 -22
- astrbot/core/platform/sources/webchat/webchat_event.py +46 -22
- astrbot/core/platform/sources/webchat/webchat_queue_mgr.py +35 -0
- astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py +926 -0
- astrbot/core/platform/sources/wechatpadpro/wechatpadpro_message_event.py +178 -0
- astrbot/core/platform/sources/wechatpadpro/xml_data_parser.py +159 -0
- astrbot/core/platform/sources/wecom/wecom_adapter.py +169 -27
- astrbot/core/platform/sources/wecom/wecom_event.py +162 -77
- astrbot/core/platform/sources/wecom/wecom_kf.py +279 -0
- astrbot/core/platform/sources/wecom/wecom_kf_message.py +196 -0
- astrbot/core/platform/sources/wecom_ai_bot/WXBizJsonMsgCrypt.py +297 -0
- astrbot/core/platform/sources/wecom_ai_bot/__init__.py +15 -0
- astrbot/core/platform/sources/wecom_ai_bot/ierror.py +19 -0
- astrbot/core/platform/sources/wecom_ai_bot/wecomai_adapter.py +472 -0
- astrbot/core/platform/sources/wecom_ai_bot/wecomai_api.py +417 -0
- astrbot/core/platform/sources/wecom_ai_bot/wecomai_event.py +152 -0
- astrbot/core/platform/sources/wecom_ai_bot/wecomai_queue_mgr.py +153 -0
- astrbot/core/platform/sources/wecom_ai_bot/wecomai_server.py +168 -0
- astrbot/core/platform/sources/wecom_ai_bot/wecomai_utils.py +209 -0
- astrbot/core/platform/sources/weixin_official_account/weixin_offacc_adapter.py +306 -0
- astrbot/core/platform/sources/weixin_official_account/weixin_offacc_event.py +186 -0
- astrbot/core/platform_message_history_mgr.py +49 -0
- astrbot/core/provider/__init__.py +2 -3
- astrbot/core/provider/entites.py +8 -8
- astrbot/core/provider/entities.py +154 -98
- astrbot/core/provider/func_tool_manager.py +446 -458
- astrbot/core/provider/manager.py +345 -207
- astrbot/core/provider/provider.py +188 -73
- astrbot/core/provider/register.py +9 -7
- astrbot/core/provider/sources/anthropic_source.py +295 -115
- astrbot/core/provider/sources/azure_tts_source.py +224 -0
- astrbot/core/provider/sources/bailian_rerank_source.py +236 -0
- astrbot/core/provider/sources/dashscope_tts.py +138 -14
- astrbot/core/provider/sources/edge_tts_source.py +24 -19
- astrbot/core/provider/sources/fishaudio_tts_api_source.py +58 -13
- astrbot/core/provider/sources/gemini_embedding_source.py +61 -0
- astrbot/core/provider/sources/gemini_source.py +310 -132
- astrbot/core/provider/sources/gemini_tts_source.py +81 -0
- astrbot/core/provider/sources/groq_source.py +15 -0
- astrbot/core/provider/sources/gsv_selfhosted_source.py +151 -0
- astrbot/core/provider/sources/gsvi_tts_source.py +14 -7
- astrbot/core/provider/sources/minimax_tts_api_source.py +159 -0
- astrbot/core/provider/sources/openai_embedding_source.py +40 -0
- astrbot/core/provider/sources/openai_source.py +241 -145
- astrbot/core/provider/sources/openai_tts_api_source.py +18 -7
- astrbot/core/provider/sources/sensevoice_selfhosted_source.py +13 -11
- astrbot/core/provider/sources/vllm_rerank_source.py +71 -0
- astrbot/core/provider/sources/volcengine_tts.py +115 -0
- astrbot/core/provider/sources/whisper_api_source.py +18 -13
- astrbot/core/provider/sources/whisper_selfhosted_source.py +19 -12
- astrbot/core/provider/sources/xinference_rerank_source.py +116 -0
- astrbot/core/provider/sources/xinference_stt_provider.py +197 -0
- astrbot/core/provider/sources/zhipu_source.py +6 -73
- astrbot/core/star/__init__.py +43 -11
- astrbot/core/star/config.py +17 -18
- astrbot/core/star/context.py +362 -138
- astrbot/core/star/filter/__init__.py +4 -3
- astrbot/core/star/filter/command.py +111 -35
- astrbot/core/star/filter/command_group.py +46 -34
- astrbot/core/star/filter/custom_filter.py +6 -5
- astrbot/core/star/filter/event_message_type.py +4 -2
- astrbot/core/star/filter/permission.py +4 -2
- astrbot/core/star/filter/platform_adapter_type.py +45 -12
- astrbot/core/star/filter/regex.py +4 -2
- astrbot/core/star/register/__init__.py +19 -15
- astrbot/core/star/register/star.py +41 -13
- astrbot/core/star/register/star_handler.py +236 -86
- astrbot/core/star/session_llm_manager.py +280 -0
- astrbot/core/star/session_plugin_manager.py +170 -0
- astrbot/core/star/star.py +36 -43
- astrbot/core/star/star_handler.py +47 -85
- astrbot/core/star/star_manager.py +442 -260
- astrbot/core/star/star_tools.py +167 -45
- astrbot/core/star/updator.py +17 -20
- astrbot/core/umop_config_router.py +106 -0
- astrbot/core/updator.py +38 -13
- astrbot/core/utils/astrbot_path.py +39 -0
- astrbot/core/utils/command_parser.py +1 -1
- astrbot/core/utils/io.py +119 -60
- astrbot/core/utils/log_pipe.py +1 -1
- astrbot/core/utils/metrics.py +11 -10
- astrbot/core/utils/migra_helper.py +73 -0
- astrbot/core/utils/path_util.py +63 -62
- astrbot/core/utils/pip_installer.py +37 -15
- astrbot/core/utils/session_lock.py +29 -0
- astrbot/core/utils/session_waiter.py +19 -20
- astrbot/core/utils/shared_preferences.py +174 -34
- astrbot/core/utils/t2i/__init__.py +4 -1
- astrbot/core/utils/t2i/local_strategy.py +386 -238
- astrbot/core/utils/t2i/network_strategy.py +109 -49
- astrbot/core/utils/t2i/renderer.py +29 -14
- astrbot/core/utils/t2i/template/astrbot_powershell.html +184 -0
- astrbot/core/utils/t2i/template_manager.py +111 -0
- astrbot/core/utils/tencent_record_helper.py +115 -1
- astrbot/core/utils/version_comparator.py +10 -13
- astrbot/core/zip_updator.py +112 -65
- astrbot/dashboard/routes/__init__.py +20 -13
- astrbot/dashboard/routes/auth.py +20 -9
- astrbot/dashboard/routes/chat.py +297 -141
- astrbot/dashboard/routes/config.py +652 -55
- astrbot/dashboard/routes/conversation.py +107 -37
- astrbot/dashboard/routes/file.py +26 -0
- astrbot/dashboard/routes/knowledge_base.py +1244 -0
- astrbot/dashboard/routes/log.py +27 -2
- astrbot/dashboard/routes/persona.py +202 -0
- astrbot/dashboard/routes/plugin.py +197 -139
- astrbot/dashboard/routes/route.py +27 -7
- astrbot/dashboard/routes/session_management.py +354 -0
- astrbot/dashboard/routes/stat.py +85 -18
- astrbot/dashboard/routes/static_file.py +5 -2
- astrbot/dashboard/routes/t2i.py +233 -0
- astrbot/dashboard/routes/tools.py +184 -120
- astrbot/dashboard/routes/update.py +59 -36
- astrbot/dashboard/server.py +96 -36
- astrbot/dashboard/utils.py +165 -0
- astrbot-4.7.0.dist-info/METADATA +294 -0
- astrbot-4.7.0.dist-info/RECORD +274 -0
- {astrbot-3.5.6.dist-info → astrbot-4.7.0.dist-info}/WHEEL +1 -1
- astrbot/core/db/plugin/sqlite_impl.py +0 -112
- astrbot/core/db/sqlite_init.sql +0 -50
- astrbot/core/pipeline/platform_compatibility/stage.py +0 -56
- astrbot/core/pipeline/process_stage/method/llm_request.py +0 -606
- astrbot/core/platform/sources/gewechat/client.py +0 -806
- astrbot/core/platform/sources/gewechat/downloader.py +0 -55
- astrbot/core/platform/sources/gewechat/gewechat_event.py +0 -255
- astrbot/core/platform/sources/gewechat/gewechat_platform_adapter.py +0 -103
- astrbot/core/platform/sources/gewechat/xml_data_parser.py +0 -110
- astrbot/core/provider/sources/dashscope_source.py +0 -203
- astrbot/core/provider/sources/dify_source.py +0 -281
- astrbot/core/provider/sources/llmtuner_source.py +0 -132
- astrbot/core/rag/embedding/openai_source.py +0 -20
- astrbot/core/rag/knowledge_db_mgr.py +0 -94
- astrbot/core/rag/store/__init__.py +0 -9
- astrbot/core/rag/store/chroma_db.py +0 -42
- astrbot/core/utils/dify_api_client.py +0 -152
- astrbot-3.5.6.dist-info/METADATA +0 -249
- astrbot-3.5.6.dist-info/RECORD +0 -158
- {astrbot-3.5.6.dist-info → astrbot-4.7.0.dist-info}/entry_points.txt +0 -0
- {astrbot-3.5.6.dist-info → astrbot-4.7.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
from typing import List, Dict
|
|
3
|
-
from astrbot.core import logger
|
|
4
|
-
from .store import Store
|
|
5
|
-
from astrbot.core.config import AstrBotConfig
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class KnowledgeDBManager:
|
|
9
|
-
def __init__(self, astrbot_config: AstrBotConfig) -> None:
|
|
10
|
-
self.db_path = "data/knowledge_db/"
|
|
11
|
-
self.config = astrbot_config.get("knowledge_db", {})
|
|
12
|
-
self.astrbot_config = astrbot_config
|
|
13
|
-
if not os.path.exists(self.db_path):
|
|
14
|
-
os.makedirs(self.db_path)
|
|
15
|
-
self.store_insts: Dict[str, Store] = {}
|
|
16
|
-
for name, cfg in self.config.items():
|
|
17
|
-
if cfg["strategy"] == "embedding":
|
|
18
|
-
logger.info(f"加载 Chroma Vector Store:{name}")
|
|
19
|
-
try:
|
|
20
|
-
from .store.chroma_db import ChromaVectorStore
|
|
21
|
-
except ImportError as ie:
|
|
22
|
-
logger.error(f"{ie} 可能未安装 chromadb 库。")
|
|
23
|
-
continue
|
|
24
|
-
self.store_insts[name] = ChromaVectorStore(
|
|
25
|
-
name, cfg["embedding_config"]
|
|
26
|
-
)
|
|
27
|
-
else:
|
|
28
|
-
logger.error(f"不支持的策略:{cfg['strategy']}")
|
|
29
|
-
|
|
30
|
-
async def list_knowledge_db(self) -> List[str]:
|
|
31
|
-
return [
|
|
32
|
-
f
|
|
33
|
-
for f in os.listdir(self.db_path)
|
|
34
|
-
if os.path.isfile(os.path.join(self.db_path, f))
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
async def create_knowledge_db(self, name: str, config: Dict):
|
|
38
|
-
"""
|
|
39
|
-
config 格式:
|
|
40
|
-
```
|
|
41
|
-
{
|
|
42
|
-
"strategy": "embedding", # 目前只支持 embedding
|
|
43
|
-
"chunk_method": {
|
|
44
|
-
"strategy": "fixed",
|
|
45
|
-
"chunk_size": 100,
|
|
46
|
-
"overlap_size": 10
|
|
47
|
-
},
|
|
48
|
-
"embedding_config": {
|
|
49
|
-
"strategy": "openai",
|
|
50
|
-
"base_url": "",
|
|
51
|
-
"model": "",
|
|
52
|
-
"api_key": ""
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
"""
|
|
57
|
-
if name in self.config:
|
|
58
|
-
raise ValueError(f"知识库已存在:{name}")
|
|
59
|
-
|
|
60
|
-
self.config[name] = config
|
|
61
|
-
self.astrbot_config["knowledge_db"] = self.config
|
|
62
|
-
self.astrbot_config.save_config()
|
|
63
|
-
|
|
64
|
-
async def insert_record(self, name: str, text: str):
|
|
65
|
-
if name not in self.store_insts:
|
|
66
|
-
raise ValueError(f"未找到知识库:{name}")
|
|
67
|
-
|
|
68
|
-
ret = []
|
|
69
|
-
match self.config[name]["chunk_method"]["strategy"]:
|
|
70
|
-
case "fixed":
|
|
71
|
-
chunk_size = self.config[name]["chunk_method"]["chunk_size"]
|
|
72
|
-
chunk_overlap = self.config[name]["chunk_method"]["overlap_size"]
|
|
73
|
-
ret = self._fixed_chunk(text, chunk_size, chunk_overlap)
|
|
74
|
-
case _:
|
|
75
|
-
pass
|
|
76
|
-
|
|
77
|
-
for chunk in ret:
|
|
78
|
-
await self.store_insts[name].save(chunk)
|
|
79
|
-
|
|
80
|
-
async def retrive_records(self, name: str, query: str, top_n: int = 3) -> List[str]:
|
|
81
|
-
if name not in self.store_insts:
|
|
82
|
-
raise ValueError(f"未找到知识库:{name}")
|
|
83
|
-
|
|
84
|
-
inst = self.store_insts[name]
|
|
85
|
-
return await inst.query(query, top_n)
|
|
86
|
-
|
|
87
|
-
def _fixed_chunk(self, text: str, chunk_size: int, chunk_overlap: int) -> List[str]:
|
|
88
|
-
chunks = []
|
|
89
|
-
start = 0
|
|
90
|
-
while start < len(text):
|
|
91
|
-
end = start + chunk_size
|
|
92
|
-
chunks.append(text[start:end])
|
|
93
|
-
start += chunk_size - chunk_overlap
|
|
94
|
-
return chunks
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import chromadb
|
|
2
|
-
import uuid
|
|
3
|
-
from typing import List, Dict
|
|
4
|
-
from astrbot.api import logger
|
|
5
|
-
from ..embedding.openai_source import SimpleOpenAIEmbedding
|
|
6
|
-
from . import Store
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class ChromaVectorStore(Store):
|
|
10
|
-
def __init__(self, name: str, embedding_cfg: Dict) -> None:
|
|
11
|
-
self.chroma_client = chromadb.PersistentClient(
|
|
12
|
-
path="data/long_term_memory_chroma.db"
|
|
13
|
-
)
|
|
14
|
-
self.collection = self.chroma_client.get_or_create_collection(name=name)
|
|
15
|
-
self.embedding = None
|
|
16
|
-
if embedding_cfg["strategy"] == "openai":
|
|
17
|
-
self.embedding = SimpleOpenAIEmbedding(
|
|
18
|
-
model=embedding_cfg["model"],
|
|
19
|
-
api_key=embedding_cfg["api_key"],
|
|
20
|
-
api_base=embedding_cfg.get("base_url", None),
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
async def save(self, text: str, metadata: Dict = None):
|
|
24
|
-
logger.debug(f"Saving text: {text}")
|
|
25
|
-
embedding = await self.embedding.get_embedding(text)
|
|
26
|
-
|
|
27
|
-
self.collection.upsert(
|
|
28
|
-
documents=text,
|
|
29
|
-
metadatas=metadata,
|
|
30
|
-
ids=str(uuid.uuid4()),
|
|
31
|
-
embeddings=embedding,
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
async def query(
|
|
35
|
-
self, query: str, top_n=3, metadata_filter: Dict = None
|
|
36
|
-
) -> List[str]:
|
|
37
|
-
embedding = await self.embedding.get_embedding(query)
|
|
38
|
-
|
|
39
|
-
results = self.collection.query(
|
|
40
|
-
query_embeddings=embedding, n_results=top_n, where=metadata_filter
|
|
41
|
-
)
|
|
42
|
-
return results["documents"][0]
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
from astrbot.core import logger
|
|
3
|
-
from aiohttp import ClientSession
|
|
4
|
-
from typing import Dict, List, Any, AsyncGenerator
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class DifyAPIClient:
|
|
8
|
-
def __init__(self, api_key: str, api_base: str = "https://api.dify.ai/v1"):
|
|
9
|
-
self.api_key = api_key
|
|
10
|
-
self.api_base = api_base
|
|
11
|
-
self.session = ClientSession(trust_env=True)
|
|
12
|
-
self.headers = {
|
|
13
|
-
"Authorization": f"Bearer {self.api_key}",
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async def chat_messages(
|
|
17
|
-
self,
|
|
18
|
-
inputs: Dict,
|
|
19
|
-
query: str,
|
|
20
|
-
user: str,
|
|
21
|
-
response_mode: str = "streaming",
|
|
22
|
-
conversation_id: str = "",
|
|
23
|
-
files: List[Dict[str, Any]] = [],
|
|
24
|
-
timeout: float = 60,
|
|
25
|
-
) -> AsyncGenerator[Dict[str, Any], None]:
|
|
26
|
-
url = f"{self.api_base}/chat-messages"
|
|
27
|
-
payload = locals()
|
|
28
|
-
payload.pop("self")
|
|
29
|
-
payload.pop("timeout")
|
|
30
|
-
logger.info(f"chat_messages payload: {payload}")
|
|
31
|
-
async with self.session.post(
|
|
32
|
-
url, json=payload, headers=self.headers, timeout=timeout
|
|
33
|
-
) as resp:
|
|
34
|
-
if resp.status != 200:
|
|
35
|
-
text = await resp.text()
|
|
36
|
-
raise Exception(f"chat_messages 请求失败:{resp.status}. {text}")
|
|
37
|
-
|
|
38
|
-
buffer = ""
|
|
39
|
-
while True:
|
|
40
|
-
# 保持原有的8192字节限制,防止数据过大导致高水位报错
|
|
41
|
-
chunk = await resp.content.read(8192)
|
|
42
|
-
if not chunk:
|
|
43
|
-
break
|
|
44
|
-
|
|
45
|
-
buffer += chunk.decode("utf-8")
|
|
46
|
-
blocks = buffer.split("\n\n")
|
|
47
|
-
|
|
48
|
-
# 处理完整的数据块
|
|
49
|
-
for block in blocks[:-1]:
|
|
50
|
-
if block.strip() and block.startswith("data:"):
|
|
51
|
-
try:
|
|
52
|
-
json_str = block[5:] # 移除 "data:" 前缀
|
|
53
|
-
json_obj = json.loads(json_str)
|
|
54
|
-
yield json_obj
|
|
55
|
-
except json.JSONDecodeError as e:
|
|
56
|
-
logger.error(f"JSON解析错误: {str(e)}")
|
|
57
|
-
logger.error(f"原始数据块: {json_str}")
|
|
58
|
-
|
|
59
|
-
# 保留最后一个可能不完整的块
|
|
60
|
-
buffer = blocks[-1] if blocks else ""
|
|
61
|
-
|
|
62
|
-
async def workflow_run(
|
|
63
|
-
self,
|
|
64
|
-
inputs: Dict,
|
|
65
|
-
user: str,
|
|
66
|
-
response_mode: str = "streaming",
|
|
67
|
-
files: List[Dict[str, Any]] = [],
|
|
68
|
-
timeout: float = 60,
|
|
69
|
-
):
|
|
70
|
-
url = f"{self.api_base}/workflows/run"
|
|
71
|
-
payload = locals()
|
|
72
|
-
payload.pop("self")
|
|
73
|
-
payload.pop("timeout")
|
|
74
|
-
logger.info(f"workflow_run payload: {payload}")
|
|
75
|
-
async with self.session.post(
|
|
76
|
-
url, json=payload, headers=self.headers, timeout=timeout
|
|
77
|
-
) as resp:
|
|
78
|
-
if resp.status != 200:
|
|
79
|
-
text = await resp.text()
|
|
80
|
-
raise Exception(f"workflow_run 请求失败:{resp.status}. {text}")
|
|
81
|
-
|
|
82
|
-
buffer = ""
|
|
83
|
-
while True:
|
|
84
|
-
# 保持原有的8192字节限制,防止数据过大导致高水位报错
|
|
85
|
-
chunk = await resp.content.read(8192)
|
|
86
|
-
if not chunk:
|
|
87
|
-
break
|
|
88
|
-
|
|
89
|
-
buffer += chunk.decode("utf-8")
|
|
90
|
-
blocks = buffer.split("\n\n")
|
|
91
|
-
|
|
92
|
-
# 处理完整的数据块
|
|
93
|
-
for block in blocks[:-1]:
|
|
94
|
-
if block.strip() and block.startswith("data:"):
|
|
95
|
-
try:
|
|
96
|
-
json_str = block[5:] # 移除 "data:" 前缀
|
|
97
|
-
json_obj = json.loads(json_str)
|
|
98
|
-
yield json_obj
|
|
99
|
-
except json.JSONDecodeError as e:
|
|
100
|
-
logger.error(f"JSON解析错误: {str(e)}")
|
|
101
|
-
logger.error(f"原始数据块: {json_str}")
|
|
102
|
-
|
|
103
|
-
# 保留最后一个可能不完整的块
|
|
104
|
-
buffer = blocks[-1] if blocks else ""
|
|
105
|
-
|
|
106
|
-
async def file_upload(
|
|
107
|
-
self,
|
|
108
|
-
file_path: str,
|
|
109
|
-
user: str,
|
|
110
|
-
) -> Dict[str, Any]:
|
|
111
|
-
url = f"{self.api_base}/files/upload"
|
|
112
|
-
payload = {
|
|
113
|
-
"user": user,
|
|
114
|
-
"file": open(file_path, "rb"),
|
|
115
|
-
}
|
|
116
|
-
async with self.session.post(url, data=payload, headers=self.headers) as resp:
|
|
117
|
-
return await resp.json() # {"id": "xxx", ...}
|
|
118
|
-
|
|
119
|
-
async def close(self):
|
|
120
|
-
await self.session.close()
|
|
121
|
-
|
|
122
|
-
async def get_chat_convs(self, user: str, limit: int = 20):
|
|
123
|
-
# conversations. GET
|
|
124
|
-
url = f"{self.api_base}/conversations"
|
|
125
|
-
payload = {
|
|
126
|
-
"user": user,
|
|
127
|
-
"limit": limit,
|
|
128
|
-
}
|
|
129
|
-
async with self.session.get(url, params=payload, headers=self.headers) as resp:
|
|
130
|
-
return await resp.json()
|
|
131
|
-
|
|
132
|
-
async def delete_chat_conv(self, user: str, conversation_id: str):
|
|
133
|
-
# conversation. DELETE
|
|
134
|
-
url = f"{self.api_base}/conversations/{conversation_id}"
|
|
135
|
-
payload = {
|
|
136
|
-
"user": user,
|
|
137
|
-
}
|
|
138
|
-
async with self.session.delete(url, json=payload, headers=self.headers) as resp:
|
|
139
|
-
return await resp.json()
|
|
140
|
-
|
|
141
|
-
async def rename(
|
|
142
|
-
self, conversation_id: str, name: str, user: str, auto_generate: bool = False
|
|
143
|
-
):
|
|
144
|
-
# /conversations/:conversation_id/name
|
|
145
|
-
url = f"{self.api_base}/conversations/{conversation_id}/name"
|
|
146
|
-
payload = {
|
|
147
|
-
"user": user,
|
|
148
|
-
"name": name,
|
|
149
|
-
"auto_generate": auto_generate,
|
|
150
|
-
}
|
|
151
|
-
async with self.session.post(url, json=payload, headers=self.headers) as resp:
|
|
152
|
-
return await resp.json()
|
astrbot-3.5.6.dist-info/METADATA
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: AstrBot
|
|
3
|
-
Version: 3.5.6
|
|
4
|
-
Summary: 易上手的多平台 LLM 聊天机器人及开发框架
|
|
5
|
-
License-File: LICENSE
|
|
6
|
-
Requires-Python: >=3.10
|
|
7
|
-
Requires-Dist: aiocqhttp>=1.4.4
|
|
8
|
-
Requires-Dist: aiodocker>=0.24.0
|
|
9
|
-
Requires-Dist: aiohttp>=3.11.14
|
|
10
|
-
Requires-Dist: anthropic>=0.49.0
|
|
11
|
-
Requires-Dist: apscheduler>=3.11.0
|
|
12
|
-
Requires-Dist: beautifulsoup4>=4.13.3
|
|
13
|
-
Requires-Dist: certifi>=2025.1.31
|
|
14
|
-
Requires-Dist: chardet~=5.1.0
|
|
15
|
-
Requires-Dist: colorlog>=6.9.0
|
|
16
|
-
Requires-Dist: cryptography>=44.0.2
|
|
17
|
-
Requires-Dist: dashscope>=1.22.2
|
|
18
|
-
Requires-Dist: defusedxml>=0.7.1
|
|
19
|
-
Requires-Dist: dingtalk-stream>=0.22.1
|
|
20
|
-
Requires-Dist: docstring-parser>=0.16
|
|
21
|
-
Requires-Dist: google-genai>=1.10.0
|
|
22
|
-
Requires-Dist: googlesearch-python>=1.3.0
|
|
23
|
-
Requires-Dist: lark-oapi>=1.4.12
|
|
24
|
-
Requires-Dist: lxml-html-clean>=0.4.1
|
|
25
|
-
Requires-Dist: mcp>=1.5.0
|
|
26
|
-
Requires-Dist: openai>=1.68.2
|
|
27
|
-
Requires-Dist: ormsgpack>=1.9.0
|
|
28
|
-
Requires-Dist: pillow>=11.1.0
|
|
29
|
-
Requires-Dist: pip>=25.0.1
|
|
30
|
-
Requires-Dist: psutil>=5.8.0
|
|
31
|
-
Requires-Dist: pydantic~=2.10.3
|
|
32
|
-
Requires-Dist: pyjwt>=2.10.1
|
|
33
|
-
Requires-Dist: python-telegram-bot>=22.0
|
|
34
|
-
Requires-Dist: qq-botpy>=1.2.1
|
|
35
|
-
Requires-Dist: quart>=0.20.0
|
|
36
|
-
Requires-Dist: readability-lxml>=0.8.1
|
|
37
|
-
Requires-Dist: silk-python>=0.2.6
|
|
38
|
-
Requires-Dist: telegramify-markdown>=0.5.0
|
|
39
|
-
Requires-Dist: wechatpy>=1.8.18
|
|
40
|
-
Description-Content-Type: text/markdown
|
|
41
|
-
|
|
42
|
-
<p align="center">
|
|
43
|
-
|
|
44
|
-

|
|
45
|
-
|
|
46
|
-
</p>
|
|
47
|
-
|
|
48
|
-
<div align="center">
|
|
49
|
-
|
|
50
|
-
_✨ 易上手的多平台 LLM 聊天机器人及开发框架 ✨_
|
|
51
|
-
|
|
52
|
-
<a href="https://trendshift.io/repositories/12875" target="_blank"><img src="https://trendshift.io/api/badge/repositories/12875" alt="Soulter%2FAstrBot | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
53
|
-
|
|
54
|
-
[](https://github.com/Soulter/AstrBot/releases/latest)
|
|
55
|
-
<img src="https://img.shields.io/badge/python-3.10+-blue.svg?style=for-the-badge&color=76bad9" alt="python">
|
|
56
|
-
<a href="https://hub.docker.com/r/soulter/astrbot"><img alt="Docker pull" src="https://img.shields.io/docker/pulls/soulter/astrbot.svg?style=for-the-badge&color=76bad9"/></a>
|
|
57
|
-
<a href="https://qm.qq.com/cgi-bin/qm/qr?k=wtbaNx7EioxeaqS9z7RQWVXPIxg2zYr7&jump_from=webapi&authKey=vlqnv/AV2DbJEvGIcxdlNSpfxVy+8vVqijgreRdnVKOaydpc+YSw4MctmEbr0k5"><img alt="QQ_community" src="https://img.shields.io/badge/QQ群-775869627-purple?style=for-the-badge&color=76bad9"></a>
|
|
58
|
-
<a href="https://t.me/+hAsD2Ebl5as3NmY1"><img alt="Telegram_community" src="https://img.shields.io/badge/Telegram-AstrBot-purple?style=for-the-badge&color=76bad9"></a>
|
|
59
|
-
[](https://wakatime.com/badge/user/915e5316-99c6-4563-a483-ef186cf000c9/project/018e705a-a1a7-409a-a849-3013485e6c8e)
|
|
60
|
-

|
|
61
|
-

|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<a href="https://github.com/Soulter/AstrBot/blob/master/README_en.md">English</a> |
|
|
65
|
-
<a href="https://github.com/Soulter/AstrBot/blob/master/README_ja.md">日本語</a> |
|
|
66
|
-
<a href="https://astrbot.app/">查看文档</a> |
|
|
67
|
-
<a href="https://github.com/Soulter/AstrBot/issues">问题提交</a>
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
AstrBot 是一个松耦合、异步、支持多消息平台部署、具有易用的插件系统和完善的大语言模型(LLM)接入功能的聊天机器人及开发框架。
|
|
71
|
-
|
|
72
|
-
[](https://gitcode.com/Soulter/AstrBot)
|
|
73
|
-
|
|
74
|
-
<!-- [](https://codecov.io/gh/Soulter/AstrBot)
|
|
75
|
-
-->
|
|
76
|
-
|
|
77
|
-
## ✨ 近期更新
|
|
78
|
-
|
|
79
|
-
1. AstrBot 现已支持接入 [MCP](https://modelcontextprotocol.io/) 服务器!
|
|
80
|
-
|
|
81
|
-
## ✨ 主要功能
|
|
82
|
-
|
|
83
|
-
> [!NOTE]
|
|
84
|
-
> 🪧 我们正基于前沿科研成果,设计并实现适用于角色扮演和情感陪伴的长短期记忆模型及情绪控制模型,旨在提升对话的真实性与情感表达能力。敬请期待 `v3.6.0` 版本!
|
|
85
|
-
|
|
86
|
-
1. **大语言模型对话**。支持各种大语言模型,包括 OpenAI API、Google Gemini、Llama、Deepseek、ChatGLM 等,支持接入本地部署的大模型,通过 Ollama、LLMTuner。具有多轮对话、人格情境、多模态能力,支持图片理解、语音转文字(Whisper)。
|
|
87
|
-
2. **多消息平台接入**。支持接入 QQ(OneBot)、QQ 频道、微信(Gewechat)、飞书、Telegram。后续将支持钉钉、Discord、WhatsApp、小爱音响。支持速率限制、白名单、关键词过滤、百度内容审核。
|
|
88
|
-
3. **Agent**。原生支持部分 Agent 能力,如代码执行器、自然语言待办、网页搜索。对接 [Dify 平台](https://dify.ai/),便捷接入 Dify 智能助手、知识库和 Dify 工作流。
|
|
89
|
-
4. **插件扩展**。深度优化的插件机制,支持[开发插件](https://astrbot.app/dev/plugin.html)扩展功能,极简开发。已支持安装多个插件。
|
|
90
|
-
5. **可视化管理面板**。支持可视化修改配置、插件管理、日志查看等功能,降低配置难度。集成 WebChat,可在面板上与大模型对话。
|
|
91
|
-
6. **高稳定性、高模块化**。基于事件总线和流水线的架构设计,高度模块化,低耦合。
|
|
92
|
-
|
|
93
|
-
> [!TIP]
|
|
94
|
-
> WebUI 在线体验 Demo: [https://demo.astrbot.app/](https://demo.astrbot.app/)
|
|
95
|
-
>
|
|
96
|
-
> 用户名: `astrbot`, 密码: `astrbot`。
|
|
97
|
-
|
|
98
|
-
## ✨ 使用方式
|
|
99
|
-
|
|
100
|
-
#### Docker 部署
|
|
101
|
-
|
|
102
|
-
请参阅官方文档 [使用 Docker 部署 AstrBot](https://astrbot.app/deploy/astrbot/docker.html#%E4%BD%BF%E7%94%A8-docker-%E9%83%A8%E7%BD%B2-astrbot) 。
|
|
103
|
-
|
|
104
|
-
#### Windows 一键安装器部署
|
|
105
|
-
|
|
106
|
-
请参阅官方文档 [使用 Windows 一键安装器部署 AstrBot](https://astrbot.app/deploy/astrbot/windows.html) 。
|
|
107
|
-
|
|
108
|
-
#### 宝塔面板部署
|
|
109
|
-
|
|
110
|
-
请参阅官方文档 [宝塔面板部署](https://astrbot.app/deploy/astrbot/btpanel.html) 。
|
|
111
|
-
|
|
112
|
-
#### CasaOS 部署
|
|
113
|
-
|
|
114
|
-
社区贡献的部署方式。
|
|
115
|
-
|
|
116
|
-
请参阅官方文档 [CasaOS 部署](https://astrbot.app/deploy/astrbot/casaos.html) 。
|
|
117
|
-
|
|
118
|
-
#### 手动部署
|
|
119
|
-
|
|
120
|
-
推荐使用 `uv`。
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
git clone https://github.com/AstrBotDevs/AstrBot && cd AstrBot
|
|
124
|
-
pip install uv
|
|
125
|
-
uv run main.py
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
或者请参阅官方文档 [通过源码部署 AstrBot](https://astrbot.app/deploy/astrbot/cli.html) 。
|
|
129
|
-
|
|
130
|
-
#### Replit 部署
|
|
131
|
-
|
|
132
|
-
[](https://repl.it/github/Soulter/AstrBot)
|
|
133
|
-
|
|
134
|
-
## ⚡ 消息平台支持情况
|
|
135
|
-
|
|
136
|
-
| 平台 | 支持性 | 详情 | 消息类型 |
|
|
137
|
-
| -------- | ------- | ------- | ------ |
|
|
138
|
-
| QQ(官方机器人接口) | ✔ | 私聊、群聊,QQ 频道私聊、群聊 | 文字、图片 |
|
|
139
|
-
| QQ(OneBot) | ✔ | 私聊、群聊 | 文字、图片、语音 |
|
|
140
|
-
| 微信(个人号) | ✔ | 微信个人号私聊、群聊 | 文字、图片、语音 |
|
|
141
|
-
| [Telegram](https://github.com/Soulter/astrbot_plugin_telegram) | ✔ | 私聊、群聊 | 文字、图片 |
|
|
142
|
-
| [微信(企业微信)](https://github.com/Soulter/astrbot_plugin_wecom) | ✔ | 私聊 | 文字、图片、语音 |
|
|
143
|
-
| 飞书 | ✔ | 私聊、群聊 | 文字、图片 |
|
|
144
|
-
| 钉钉 | ✔ | 私聊、群聊 | 文字、图片 |
|
|
145
|
-
| 微信对话开放平台 | 🚧 | 计划内 | - |
|
|
146
|
-
| Discord | 🚧 | 计划内 | - |
|
|
147
|
-
| WhatsApp | 🚧 | 计划内 | - |
|
|
148
|
-
| 小爱音响 | 🚧 | 计划内 | - |
|
|
149
|
-
|
|
150
|
-
## ⚡ 提供商支持情况
|
|
151
|
-
|
|
152
|
-
| 名称 | 支持性 | 类型 | 备注 |
|
|
153
|
-
| -------- | ------- | ------- | ------- |
|
|
154
|
-
| OpenAI API | ✔ | 文本生成 | 也支持 DeepSeek、Google Gemini、GLM、Kimi、硅基流动、xAI 等兼容 OpenAI API 的服务 |
|
|
155
|
-
| Claude API | ✔ | 文本生成 | |
|
|
156
|
-
| Google Gemini API | ✔ | 文本生成 | |
|
|
157
|
-
| Dify | ✔ | LLMOps | |
|
|
158
|
-
| DashScope(阿里云百炼应用) | ✔ | LLMOps | |
|
|
159
|
-
| Ollama | ✔ | 模型加载器 | 本地部署 DeepSeek、Llama 等开源语言模型 |
|
|
160
|
-
| LM Studio | ✔ | 模型加载器 | 本地部署 DeepSeek、Llama 等开源语言模型 |
|
|
161
|
-
| LLMTuner | ✔ | 模型加载器 | 本地加载 lora 等微调模型 |
|
|
162
|
-
| OneAPI | ✔ | LLM 分发系统 | |
|
|
163
|
-
| Whisper | ✔ | 语音转文本 | 支持 API、本地部署 |
|
|
164
|
-
| SenseVoice | ✔ | 语音转文本 | 本地部署 |
|
|
165
|
-
| OpenAI TTS API | ✔ | 文本转语音 | |
|
|
166
|
-
| GSVI | ✔ | 文本转语音 | GPT-Sovits-Inference |
|
|
167
|
-
| Fishaudio | ✔ | 文本转语音 | GPT-Sovits 作者参与的项目 |
|
|
168
|
-
| Edge-TTS | ✔ | 文本转语音 | Edge 浏览器的免费 TTS |
|
|
169
|
-
|
|
170
|
-
## ❤️ 贡献
|
|
171
|
-
|
|
172
|
-
欢迎任何 Issues/Pull Requests!只需要将你的更改提交到此项目 :)
|
|
173
|
-
|
|
174
|
-
### 如何贡献
|
|
175
|
-
|
|
176
|
-
你可以通过查看问题或帮助审核 PR(拉取请求)来贡献。任何问题或 PR 都欢迎参与,以促进社区贡献。当然,这些只是建议,你可以以任何方式进行贡献。对于新功能的添加,请先通过 Issue 讨论。
|
|
177
|
-
|
|
178
|
-
### 开发环境
|
|
179
|
-
|
|
180
|
-
AstrBot 使用 `ruff` 进行代码格式化和检查。
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
git clone https://github.com/Soulter/AstrBot
|
|
184
|
-
pip install pre-commit
|
|
185
|
-
pre-commit install
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## 🌟 支持
|
|
189
|
-
|
|
190
|
-
- Star 这个项目!
|
|
191
|
-
- 在[爱发电](https://afdian.com/a/soulter)支持我!
|
|
192
|
-
- 在[微信](https://drive.soulter.top/f/pYfA/d903f4fa49a496fda3f16d2be9e023b5.png)支持我~
|
|
193
|
-
|
|
194
|
-
## ✨ Demo
|
|
195
|
-
|
|
196
|
-
<details><summary>👉 点击展开多张 Demo 截图 👈</summary>
|
|
197
|
-
|
|
198
|
-
<div align='center'>
|
|
199
|
-
|
|
200
|
-
<img src="https://github.com/user-attachments/assets/4ee688d9-467d-45c8-99d6-368f9a8a92d8" width="600">
|
|
201
|
-
|
|
202
|
-
_✨基于 Docker 的沙箱化代码执行器(Beta 测试)✨_
|
|
203
|
-
|
|
204
|
-
<img src="https://github.com/user-attachments/assets/0378f407-6079-4f64-ae4c-e97ab20611d2" height=500>
|
|
205
|
-
|
|
206
|
-
_✨ 多模态、网页搜索、长文本转图片(可配置) ✨_
|
|
207
|
-
|
|
208
|
-
<img src="https://github.com/user-attachments/assets/e137a9e1-340a-4bf2-bb2b-771132780735" height=150>
|
|
209
|
-
<img src="https://github.com/user-attachments/assets/480f5e82-cf6a-4955-a869-0d73137aa6e1" height=150>
|
|
210
|
-
|
|
211
|
-
_✨ 插件系统——部分插件展示 ✨_
|
|
212
|
-
|
|
213
|
-
<img src="https://github.com/user-attachments/assets/0cdbf564-2f59-4da5-b524-ce0e7ef3d978" width=600>
|
|
214
|
-
|
|
215
|
-
_✨ WebUI ✨_
|
|
216
|
-
|
|
217
|
-
</div>
|
|
218
|
-
|
|
219
|
-
</details>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
## ❤️ Special Thanks
|
|
223
|
-
|
|
224
|
-
特别感谢所有 Contributors 和插件开发者对 AstrBot 的贡献 ❤️
|
|
225
|
-
|
|
226
|
-
<a href="https://github.com/AstrBotDevs/AstrBot/graphs/contributors">
|
|
227
|
-
<img src="https://contrib.rocks/image?repo=AstrBotDevs/AstrBot" />
|
|
228
|
-
</a>
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
## ⭐ Star History
|
|
232
|
-
|
|
233
|
-
> [!TIP]
|
|
234
|
-
> 如果本项目对您的生活 / 工作产生了帮助,或者您关注本项目的未来发展,请给项目 Star,这是我维护这个开源项目的动力 <3
|
|
235
|
-
|
|
236
|
-
<div align="center">
|
|
237
|
-
|
|
238
|
-
[](https://star-history.com/#soulter/astrbot&Date)
|
|
239
|
-
|
|
240
|
-
</div>
|
|
241
|
-
|
|
242
|
-
## Disclaimer
|
|
243
|
-
|
|
244
|
-
1. The project is protected under the `AGPL-v3` opensource license.
|
|
245
|
-
2. The deployment of WeChat (personal account) utilizes [Gewechat](https://github.com/Devo919/Gewechat) service. AstrBot only guarantees connectivity with Gewechat and recommends using a WeChat account that is not frequently used. In the event of account risk control, the author of this project shall not bear any responsibility.
|
|
246
|
-
3. Please ensure compliance with local laws and regulations when using this project.
|
|
247
|
-
|
|
248
|
-
_私は、高性能ですから!_
|
|
249
|
-
|