Skip to content

Platform API

字数
363 字
阅读时间
2 分钟

pallas.api.platform:官方插件与内置插件的平台协作钩子。稳定性高于随意 pallas.core.* import,但仍次于面向社区的 pallas.api.* 其它子包。

模块文档串:pallas/api/platform/__init__.py

依赖分层

对象社区插件
L1pallas.api.commands / config / perm / …MUST
L2pallas.api.platform默认禁止;仅当确需舰队 / 分片 / callback
L3pallas.core.* / console.* / 深层 product.*禁止

社区插件若大量依赖 L2,通常边界过深,应提缺口升级为 L1 或改设计。

导出分组(现行 __all__

分组代表符号
AI callbackregister_media_task_hooksDRAW_IMAGE_TASK_TYPE
Bot 角色bot_roleis_sharded_hubis_sharded_workeris_sharding_active
发送不可用is_bot_send_unavailablelog_bot_send_unavailable
Ingresstext_matches_plugin_fanoutdream_session_ingress_passes
多 Bot / claimtry_claim_group_message_oncebegin_group_exclusive_activityclaim_group_handler
舰队get_fleet_bot_idsconnected_bot_idslist_local_fleet_bots_in_group
分片在线 / 代发get_cluster_online_bot_idssend_group_message_as_botinvoke_bot_action
LLM(平台协作)get_llm_configllm_server_base_urlllm_command_tool_row

完整列表以模块 __all__ 为准;新增导出需同步本表。

准入(进入本页的平台边界)

  • 被多个模块长期依赖
  • 预期跨小版本保留
  • 可用语义描述,不暴露当前文件布局
  • 调用方无需理解大量内部实现

禁止场景

  • 普通命令型插件仅为少写包装而跳过 L1
  • 把 Platform 当随意内部捷径

相关