Compare commits

...

2 Commits

13 changed files with 182 additions and 179 deletions
+13 -20
View File
@@ -99,6 +99,8 @@ class MainAgentBuildConfig:
"""This will inject healthy and safe system prompt into the main agent, """This will inject healthy and safe system prompt into the main agent,
to prevent LLM output harmful information""" to prevent LLM output harmful information"""
safety_mode_strategy: str = "system_prompt" safety_mode_strategy: str = "system_prompt"
computer_use_runtime: str = "local"
"""The runtime for agent computer use: none, local, or sandbox."""
sandbox_cfg: dict = field(default_factory=dict) sandbox_cfg: dict = field(default_factory=dict)
add_cron_tools: bool = True add_cron_tools: bool = True
"""This will add cron job management tools to the main agent for proactive cron job execution.""" """This will add cron job management tools to the main agent for proactive cron job execution."""
@@ -247,7 +249,6 @@ def _apply_local_env_tools(req: ProviderRequest) -> None:
req.func_tool.add_tool(LOCAL_EXECUTE_SHELL_TOOL) req.func_tool.add_tool(LOCAL_EXECUTE_SHELL_TOOL)
req.func_tool.add_tool(LOCAL_PYTHON_TOOL) req.func_tool.add_tool(LOCAL_PYTHON_TOOL)
async def _ensure_persona_and_skills( async def _ensure_persona_and_skills(
req: ProviderRequest, req: ProviderRequest,
cfg: dict, cfg: dict,
@@ -301,21 +302,11 @@ async def _ensure_persona_and_skills(
req.system_prompt += CHATUI_SPECIAL_DEFAULT_PERSONA_PROMPT req.system_prompt += CHATUI_SPECIAL_DEFAULT_PERSONA_PROMPT
# Inject skills prompt # Inject skills prompt
skills_cfg = cfg.get("skills", {}) runtime = cfg.get("computer_use_runtime", "local")
sandbox_cfg = cfg.get("sandbox", {})
skill_manager = SkillManager() skill_manager = SkillManager()
runtime = skills_cfg.get("runtime", "local")
skills = skill_manager.list_skills(active_only=True, runtime=runtime) skills = skill_manager.list_skills(active_only=True, runtime=runtime)
if runtime == "sandbox" and not sandbox_cfg.get("enable", False): if skills:
logger.warning(
"Skills runtime is set to sandbox, but sandbox mode is disabled, will skip skills prompt injection.",
)
req.system_prompt += (
"\n[Background: User added some skills, and skills runtime is set to sandbox, "
"but sandbox mode is disabled. So skills will be unavailable.]\n"
)
elif skills:
if persona and persona.get("skills") is not None: if persona and persona.get("skills") is not None:
if not persona["skills"]: if not persona["skills"]:
skills = [] skills = []
@@ -324,12 +315,12 @@ async def _ensure_persona_and_skills(
skills = [skill for skill in skills if skill.name in allowed] skills = [skill for skill in skills if skill.name in allowed]
if skills: if skills:
req.system_prompt += f"\n{build_skills_prompt(skills)}\n" req.system_prompt += f"\n{build_skills_prompt(skills)}\n"
if runtime == "none":
runtime = skills_cfg.get("runtime", "local") req.system_prompt += (
sandbox_enabled = sandbox_cfg.get("enable", False) "User has not enabled the Computer Use feature. "
if runtime == "local" and not sandbox_enabled: "You cannot use shell or Python to perform skills. "
_apply_local_env_tools(req) "If you need to use these capabilities, ask the user to enable Computer Use in the AstrBot WebUI -> Config."
)
tmgr = plugin_context.get_llm_tool_manager() tmgr = plugin_context.get_llm_tool_manager()
# sub agents integration # sub agents integration
@@ -922,8 +913,10 @@ async def build_main_agent(
if config.llm_safety_mode: if config.llm_safety_mode:
_apply_llm_safety_mode(config, req) _apply_llm_safety_mode(config, req)
if config.sandbox_cfg.get("enable", False): if config.computer_use_runtime == "sandbox":
_apply_sandbox_tools(config, req, req.session_id) _apply_sandbox_tools(config, req, req.session_id)
elif config.computer_use_runtime == "local":
_apply_local_env_tools(req)
agent_runner = AgentRunner() agent_runner = AgentRunner()
astr_agent_ctx = AstrAgentContext( astr_agent_ctx = AstrAgentContext(
+75 -93
View File
@@ -117,15 +117,14 @@ DEFAULT_CONFIG = {
"proactive_capability": { "proactive_capability": {
"add_cron_tools": True, "add_cron_tools": True,
}, },
"computer_use_runtime": "local",
"sandbox": { "sandbox": {
"enable": False,
"booter": "shipyard", "booter": "shipyard",
"shipyard_endpoint": "", "shipyard_endpoint": "",
"shipyard_access_token": "", "shipyard_access_token": "",
"shipyard_ttl": 3600, "shipyard_ttl": 3600,
"shipyard_max_sessions": 10, "shipyard_max_sessions": 10,
}, },
"skills": {"runtime": "sandbox"},
}, },
# SubAgent orchestrator mode: # SubAgent orchestrator mode:
# - main_enable = False: disabled; main LLM mounts tools normally (persona selection). # - main_enable = False: disabled; main LLM mounts tools normally (persona selection).
@@ -2225,17 +2224,6 @@ CONFIG_METADATA_2 = {
}, },
}, },
}, },
"skills": {
"type": "object",
"items": {
"enable": {
"type": "bool",
},
"runtime": {
"type": "string",
},
},
},
"proactive_capability": { "proactive_capability": {
"type": "object", "type": "object",
"items": { "items": {
@@ -2516,6 +2504,7 @@ CONFIG_METADATA_3 = {
}, },
"persona": { "persona": {
"description": "人格", "description": "人格",
"hint": "",
"type": "object", "type": "object",
"items": { "items": {
"provider_settings.default_personality": { "provider_settings.default_personality": {
@@ -2531,6 +2520,7 @@ CONFIG_METADATA_3 = {
}, },
"knowledgebase": { "knowledgebase": {
"description": "知识库", "description": "知识库",
"hint": "",
"type": "object", "type": "object",
"items": { "items": {
"kb_names": { "kb_names": {
@@ -2563,6 +2553,7 @@ CONFIG_METADATA_3 = {
}, },
"websearch": { "websearch": {
"description": "网页搜索", "description": "网页搜索",
"hint": "",
"type": "object", "type": "object",
"items": { "items": {
"provider_settings.web_search": { "provider_settings.web_search": {
@@ -2573,6 +2564,9 @@ CONFIG_METADATA_3 = {
"description": "网页搜索提供商", "description": "网页搜索提供商",
"type": "string", "type": "string",
"options": ["default", "tavily", "baidu_ai_search"], "options": ["default", "tavily", "baidu_ai_search"],
"condition": {
"provider_settings.web_search": True,
},
}, },
"provider_settings.websearch_tavily_key": { "provider_settings.websearch_tavily_key": {
"description": "Tavily API Key", "description": "Tavily API Key",
@@ -2581,6 +2575,7 @@ CONFIG_METADATA_3 = {
"hint": "可添加多个 Key 进行轮询。", "hint": "可添加多个 Key 进行轮询。",
"condition": { "condition": {
"provider_settings.websearch_provider": "tavily", "provider_settings.websearch_provider": "tavily",
"provider_settings.web_search": True,
}, },
}, },
"provider_settings.websearch_baidu_app_builder_key": { "provider_settings.websearch_baidu_app_builder_key": {
@@ -2594,6 +2589,73 @@ CONFIG_METADATA_3 = {
"provider_settings.web_search_link": { "provider_settings.web_search_link": {
"description": "显示来源引用", "description": "显示来源引用",
"type": "bool", "type": "bool",
"condition": {
"provider_settings.web_search": True,
},
},
},
"condition": {
"provider_settings.agent_runner_type": "local",
"provider_settings.enable": True,
},
},
"agent_computer_use": {
"description": "Agent Computer Use",
"hint": "",
"type": "object",
"items": {
"provider_settings.computer_use_runtime": {
"description": "Computer Use Runtime",
"type": "string",
"options": ["none", "local", "sandbox"],
"labels": ["", "本地", "沙箱"],
"hint": "选择 Computer Use 运行环境。",
},
"provider_settings.sandbox.booter": {
"description": "沙箱环境驱动器",
"type": "string",
"options": ["shipyard"],
"labels": ["Shipyard"],
"condition": {
"provider_settings.computer_use_runtime": "sandbox",
},
},
"provider_settings.sandbox.shipyard_endpoint": {
"description": "Shipyard API Endpoint",
"type": "string",
"hint": "Shipyard 服务的 API 访问地址。",
"condition": {
"provider_settings.computer_use_runtime": "sandbox",
"provider_settings.sandbox.booter": "shipyard",
},
"_special": "check_shipyard_connection",
},
"provider_settings.sandbox.shipyard_access_token": {
"description": "Shipyard Access Token",
"type": "string",
"hint": "用于访问 Shipyard 服务的访问令牌。",
"condition": {
"provider_settings.computer_use_runtime": "sandbox",
"provider_settings.sandbox.booter": "shipyard",
},
},
"provider_settings.sandbox.shipyard_ttl": {
"description": "Shipyard Session TTL",
"type": "int",
"hint": "Shipyard 会话的生存时间(秒)。",
"condition": {
"provider_settings.computer_use_runtime": "sandbox",
"provider_settings.sandbox.booter": "shipyard",
},
},
"provider_settings.sandbox.shipyard_max_sessions": {
"description": "Shipyard Max Sessions",
"type": "int",
"hint": "Shipyard 最大会话数量。",
"condition": {
"provider_settings.computer_use_runtime": "sandbox",
"provider_settings.sandbox.booter": "shipyard",
},
}, },
}, },
"condition": { "condition": {
@@ -2631,86 +2693,6 @@ CONFIG_METADATA_3 = {
# "provider_settings.enable": True, # "provider_settings.enable": True,
# }, # },
# }, # },
"sandbox": {
"description": "Agent 沙箱环境",
"hint": "",
"type": "object",
"items": {
"provider_settings.sandbox.enable": {
"description": "启用沙箱环境",
"type": "bool",
"hint": "启用后,Agent 可以使用沙箱环境中的工具和资源,如 Python 代码执行、Shell 等。",
},
"provider_settings.sandbox.booter": {
"description": "沙箱环境驱动器",
"type": "string",
"options": ["shipyard"],
"labels": ["Shipyard"],
"condition": {
"provider_settings.sandbox.enable": True,
},
},
"provider_settings.sandbox.shipyard_endpoint": {
"description": "Shipyard API Endpoint",
"type": "string",
"hint": "Shipyard 服务的 API 访问地址。",
"condition": {
"provider_settings.sandbox.enable": True,
"provider_settings.sandbox.booter": "shipyard",
},
"_special": "check_shipyard_connection",
},
"provider_settings.sandbox.shipyard_access_token": {
"description": "Shipyard Access Token",
"type": "string",
"hint": "用于访问 Shipyard 服务的访问令牌。",
"condition": {
"provider_settings.sandbox.enable": True,
"provider_settings.sandbox.booter": "shipyard",
},
},
"provider_settings.sandbox.shipyard_ttl": {
"description": "Shipyard Session TTL",
"type": "int",
"hint": "Shipyard 会话的生存时间(秒)。",
"condition": {
"provider_settings.sandbox.enable": True,
"provider_settings.sandbox.booter": "shipyard",
},
},
"provider_settings.sandbox.shipyard_max_sessions": {
"description": "Shipyard Max Sessions",
"type": "int",
"hint": "Shipyard 最大会话数量。",
"condition": {
"provider_settings.sandbox.enable": True,
"provider_settings.sandbox.booter": "shipyard",
},
},
},
"condition": {
"provider_settings.agent_runner_type": "local",
"provider_settings.enable": True,
},
},
"skills": {
"description": "Skills",
"type": "object",
"hint": "",
"items": {
"provider_settings.skills.runtime": {
"description": "Skill Runtime",
"type": "string",
"options": ["local", "sandbox"],
"labels": ["本地", "沙箱"],
"hint": "选择 Skills 运行环境。使用沙箱时需先启用沙箱环境。",
},
},
"condition": {
"provider_settings.agent_runner_type": "local",
"provider_settings.enable": True,
},
},
"proactive_capability": { "proactive_capability": {
"description": "主动型 Agent", "description": "主动型 Agent",
"hint": "https://docs.astrbot.app/use/proactive-agent.html", "hint": "https://docs.astrbot.app/use/proactive-agent.html",
@@ -92,6 +92,7 @@ class InternalAgentSubStage(Stage):
"safety_mode_strategy", "system_prompt" "safety_mode_strategy", "system_prompt"
) )
self.computer_use_runtime = settings.get("computer_use_runtime")
self.sandbox_cfg = settings.get("sandbox", {}) self.sandbox_cfg = settings.get("sandbox", {})
# Proactive capability configuration # Proactive capability configuration
@@ -116,6 +117,7 @@ class InternalAgentSubStage(Stage):
dequeue_context_length=self.dequeue_context_length, dequeue_context_length=self.dequeue_context_length,
llm_safety_mode=self.llm_safety_mode, llm_safety_mode=self.llm_safety_mode,
safety_mode_strategy=self.safety_mode_strategy, safety_mode_strategy=self.safety_mode_strategy,
computer_use_runtime=self.computer_use_runtime,
sandbox_cfg=self.sandbox_cfg, sandbox_cfg=self.sandbox_cfg,
add_cron_tools=self.add_cron_tools, add_cron_tools=self.add_cron_tools,
provider_settings=settings, provider_settings=settings,
+13 -4
View File
@@ -24,14 +24,23 @@ class SkillsRoute(Route):
async def get_skills(self): async def get_skills(self):
try: try:
cfg = self.core_lifecycle.astrbot_config.get("provider_settings", {}).get( provider_settings = self.core_lifecycle.astrbot_config.get(
"skills", {} "provider_settings", {}
) )
runtime = cfg.get("runtime", "local") runtime = provider_settings.get("computer_use_runtime", "local")
skills = SkillManager().list_skills( skills = SkillManager().list_skills(
active_only=False, runtime=runtime, show_sandbox_path=False active_only=False, runtime=runtime, show_sandbox_path=False
) )
return Response().ok([skill.__dict__ for skill in skills]).__dict__ return (
Response()
.ok(
{
"skills": [skill.__dict__ for skill in skills],
"computer_use_runtime": runtime,
}
)
.__dict__
)
except Exception as e: except Exception as e:
logger.error(traceback.format_exc()) logger.error(traceback.format_exc())
return Response().error(str(e)).__dict__ return Response().error(str(e)).__dict__
@@ -110,7 +110,15 @@ export default {
loading.value = true; loading.value = true;
try { try {
const res = await axios.get("/api/skills"); const res = await axios.get("/api/skills");
skills.value = res.data.data || []; const payload = res.data?.data || [];
if (Array.isArray(payload)) {
skills.value = payload;
} else {
skills.value = payload.skills || [];
if (payload.computer_use_runtime === "none") {
showMessage(tm("skills.runtimeNoneWarning"), "warning");
}
}
} catch (err) { } catch (err) {
showMessage(tm("skills.loadFailed"), "error"); showMessage(tm("skills.loadFailed"), "error");
} finally { } finally {
@@ -1,4 +1,5 @@
<script setup> <script setup>
import MarkdownIt from 'markdown-it'
import { VueMonacoEditor } from '@guolao/vue-monaco-editor' import { VueMonacoEditor } from '@guolao/vue-monaco-editor'
import { ref, computed } from 'vue' import { ref, computed } from 'vue'
import ConfigItemRenderer from './ConfigItemRenderer.vue' import ConfigItemRenderer from './ConfigItemRenderer.vue'
@@ -24,12 +25,23 @@ const props = defineProps({
const { t } = useI18n() const { t } = useI18n()
const { tm, getRaw } = useModuleI18n('features/config-metadata') const { tm, getRaw } = useModuleI18n('features/config-metadata')
const hintMarkdown = new MarkdownIt({
linkify: true,
breaks: true
})
// 翻译器函数 - 如果是国际化键则翻译,否则原样返回 // 翻译器函数 - 如果是国际化键则翻译,否则原样返回
const translateIfKey = (value) => { const translateIfKey = (value) => {
if (!value || typeof value !== 'string') return value if (!value || typeof value !== 'string') return value
return tm(value) return tm(value)
} }
const renderHint = (value) => {
const text = translateIfKey(value)
if (!text) return ''
return hintMarkdown.renderInline(text)
}
// 处理labels翻译 - labels可以是数组或国际化键 // 处理labels翻译 - labels可以是数组或国际化键
const getTranslatedLabels = (itemMeta) => { const getTranslatedLabels = (itemMeta) => {
if (!itemMeta?.labels) return null if (!itemMeta?.labels) return null
@@ -185,7 +197,7 @@ function getSpecialSubtype(value) {
</v-list-item-title> </v-list-item-title>
<v-list-item-subtitle class="config-hint"> <v-list-item-subtitle class="config-hint">
<span v-if="metadata[metadataKey]?.obvious_hint && metadata[metadataKey]?.hint" class="important-hint"></span> <span v-if="metadata[metadataKey]?.obvious_hint && metadata[metadataKey]?.hint" class="important-hint"></span>
{{ translateIfKey(metadata[metadataKey]?.hint) }} <span v-html="renderHint(metadata[metadataKey]?.hint)"></span>
</v-list-item-subtitle> </v-list-item-subtitle>
</v-card-text> </v-card-text>
@@ -205,7 +217,7 @@ function getSpecialSubtype(value) {
<v-list-item-subtitle class="property-hint"> <v-list-item-subtitle class="property-hint">
<span v-if="itemMeta?.obvious_hint && itemMeta?.hint" class="important-hint"></span> <span v-if="itemMeta?.obvious_hint && itemMeta?.hint" class="important-hint"></span>
{{ translateIfKey(itemMeta?.hint) }} <span v-html="renderHint(itemMeta?.hint)"></span>
</v-list-item-subtitle> </v-list-item-subtitle>
</v-list-item> </v-list-item>
</v-col> </v-col>
@@ -293,6 +305,12 @@ function getSpecialSubtype(value) {
margin-top: 2px; margin-top: 2px;
} }
.config-hint :deep(a),
.property-hint :deep(a) {
color: var(--v-theme-primary);
text-decoration: underline;
}
.metadata-key, .metadata-key,
.property-key { .property-key {
font-size: 0.85em; font-size: 0.85em;
@@ -530,8 +530,16 @@ export default {
try { try {
const response = await axios.get('/api/skills'); const response = await axios.get('/api/skills');
if (response.data.status === 'ok') { if (response.data.status === 'ok') {
const skills = response.data.data || []; const payload = response.data.data || [];
this.availableSkills = skills.filter(skill => skill.active !== false); if (Array.isArray(payload)) {
this.availableSkills = payload.filter(skill => skill.active !== false);
} else {
const skills = payload.skills || [];
this.availableSkills = skills.filter(skill => skill.active !== false);
if (payload.computer_use_runtime === 'none') {
this.$emit('error', this.tm('form.skillsRuntimeNoneWarning'));
}
}
} else { } else {
this.$emit('error', response.data.message || 'Failed to load skills'); this.$emit('error', response.data.message || 'Failed to load skills');
} }
@@ -110,7 +110,7 @@
}, },
"websearch_baidu_app_builder_key": { "websearch_baidu_app_builder_key": {
"description": "Baidu Qianfan Smart Cloud APP Builder API Key", "description": "Baidu Qianfan Smart Cloud APP Builder API Key",
"hint": "Reference: https://console.bce.baidu.com/iam/#/iam/apikey/list" "hint": "Reference: [https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)"
}, },
"web_search_link": { "web_search_link": {
"description": "Display Source Citations" "description": "Display Source Citations"
@@ -133,15 +133,15 @@
} }
} }
}, },
"sandbox": { "agent_computer_use": {
"description": "Agent Sandbox Env(Beta)", "description": "Agent Computer Use",
"hint": "https://docs.astrbot.app/en/use/astrbot-agent-sandbox.html", "hint": "Allows the AstrBot to access and use your computer or an sandbox environment to perform more complex tasks. See [Sandbox Mode](https://docs.astrbot.app/use/astrbot-agent-sandbox.html), [Skills](https://docs.astrbot.app/use/skills.html)",
"provider_settings": { "provider_settings": {
"computer_use_runtime": {
"description": "Computer Use Runtime",
"hint": "sandbox means running in a sandbox environment, local means running in a local environment, none means disabling Computer Use. If skills are uploaded, choosing none will cause them to not be usable by the Agent."
},
"sandbox": { "sandbox": {
"enable": {
"description": "Enable Sandbox Env",
"hint": "When enabled, Agent can use tools and resources in the sandbox environment, such as Python tool, Shell, etc."
},
"booter": { "booter": {
"description": "Sandbox Environment Driver" "description": "Sandbox Environment Driver"
}, },
@@ -164,21 +164,9 @@
} }
} }
}, },
"skills": {
"hint": "https://docs.astrbot.app/use/skills.html",
"description": "Skills",
"provider_settings": {
"skills": {
"runtime": {
"description": "Skill Runtime",
"hint": "Select the runtime for Skills. Sandbox runtime requires sandbox to be enabled first. In local mode, the Agent CAN FULLY ACCESS the runtime environment through Shell and Python tools, but non-admin users will be automatically prohibited from using it to ensure security."
}
}
}
},
"proactive_capability": { "proactive_capability": {
"description": "Proactive Agent", "description": "Proactive Agent",
"hint": "https://docs.astrbot.app/en/use/proactive-agent.html", "hint": "AstrBot will wake up, run your tasks, and deliver the results to you. See [Proactive Agent](https://docs.astrbot.app/en/use/proactive-agent.html)",
"provider_settings": { "provider_settings": {
"proactive_capability": { "proactive_capability": {
"add_cron_tools": { "add_cron_tools": {
@@ -189,7 +177,7 @@
} }
}, },
"truncate_and_compress": { "truncate_and_compress": {
"hint": "https://docs.astrbot.app/en/use/context-compress.html", "hint": "[Context Management](https://docs.astrbot.app/en/use/context-compress.html)",
"description": "Context Management Strategy", "description": "Context Management Strategy",
"provider_settings": { "provider_settings": {
"max_context_length": { "max_context_length": {
@@ -440,7 +428,7 @@
}, },
"emojis": { "emojis": {
"description": "Emoji List (Lark Emoji Enum Names)", "description": "Emoji List (Lark Emoji Enum Names)",
"hint": "Emoji enum names reference: https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce" "hint": "Emoji enum names reference: [https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)"
} }
} }
}, },
@@ -451,7 +439,7 @@
}, },
"emojis": { "emojis": {
"description": "Emoji List (Unicode)", "description": "Emoji List (Unicode)",
"hint": "Telegram only supports a fixed reaction set, reference: https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9" "hint": "Telegram only supports a fixed reaction set, reference: [https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)"
} }
} }
} }
@@ -608,15 +596,15 @@
}, },
"pypi_index_url": { "pypi_index_url": {
"description": "PyPI Repository URL", "description": "PyPI Repository URL",
"hint": "PyPI repository URL for installing Python dependencies. Defaults to https://mirrors.aliyun.com/pypi/simple/" "hint": "PyPI repository URL for installing Python dependencies. Defaults to [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)"
}, },
"callback_api_base": { "callback_api_base": {
"description": "Externally Accessible Callback API Address", "description": "Externally Accessible Callback API Address",
"hint": "External services may access AstrBot's backend through callback links generated by AstrBot (such as file download links). Since AstrBot cannot automatically determine the externally accessible host address in the deployment environment, this configuration item is needed to explicitly specify how external services should access AstrBot's address. Examples: http://localhost:6185, https://example.com, etc." "hint": "External services may access AstrBot's backend through callback links generated by AstrBot (such as file download links). Since AstrBot cannot automatically determine the externally accessible host address in the deployment environment, this configuration item is needed to explicitly specify how external services should access AstrBot's address. Examples: [http://localhost:6185](http://localhost:6185), [https://example.com](https://example.com), etc."
}, },
"timezone": { "timezone": {
"description": "Timezone", "description": "Timezone",
"hint": "Timezone setting. Please enter an IANA timezone name, such as Asia/Shanghai. Uses system default timezone when empty. For all timezones, see: https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab" "hint": "Timezone setting. Please enter an IANA timezone name, such as Asia/Shanghai. Uses system default timezone when empty. For all timezones, see: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)"
}, },
"http_proxy": { "http_proxy": {
"description": "HTTP Proxy", "description": "HTTP Proxy",
@@ -210,7 +210,8 @@
"deleteTitle": "Delete confirmation", "deleteTitle": "Delete confirmation",
"deleteMessage": "Are you sure you want to delete this Skill?", "deleteMessage": "Are you sure you want to delete this Skill?",
"deleteSuccess": "Deleted successfully", "deleteSuccess": "Deleted successfully",
"deleteFailed": "Delete failed" "deleteFailed": "Delete failed",
"runtimeNoneWarning": "Computer Use runtime is set to None; Skills may not run correctly because no runtime is enabled."
}, },
"card": { "card": {
"actions": { "actions": {
@@ -49,6 +49,7 @@
"loadingSkills": "Loading skills...", "loadingSkills": "Loading skills...",
"allSkillsAvailable": "Use all available Skills", "allSkillsAvailable": "Use all available Skills",
"noSkillsSelected": "No skills selected", "noSkillsSelected": "No skills selected",
"skillsRuntimeNoneWarning": "Computer Use runtime is set to None; Skills may not run correctly because no runtime is enabled.",
"createInFolder": "Will be created in \"{folder}\"", "createInFolder": "Will be created in \"{folder}\"",
"rootFolder": "All Personas" "rootFolder": "All Personas"
}, },
@@ -70,6 +70,7 @@
}, },
"persona": { "persona": {
"description": "人格", "description": "人格",
"hint": "赋予 AstrBot 人格。",
"provider_settings": { "provider_settings": {
"default_personality": { "default_personality": {
"description": "默认采用的人格" "description": "默认采用的人格"
@@ -78,6 +79,7 @@
}, },
"knowledgebase": { "knowledgebase": {
"description": "知识库", "description": "知识库",
"hint": "AstrBot 的 “外置大脑”。",
"kb_names": { "kb_names": {
"description": "知识库列表", "description": "知识库列表",
"hint": "支持多选" "hint": "支持多选"
@@ -97,6 +99,7 @@
}, },
"websearch": { "websearch": {
"description": "网页搜索", "description": "网页搜索",
"hint": "让 AstrBot 能够访问互联网,获悉时讯。",
"provider_settings": { "provider_settings": {
"web_search": { "web_search": {
"description": "启用网页搜索" "description": "启用网页搜索"
@@ -110,7 +113,7 @@
}, },
"websearch_baidu_app_builder_key": { "websearch_baidu_app_builder_key": {
"description": "百度千帆智能云 APP Builder API Key", "description": "百度千帆智能云 APP Builder API Key",
"hint": "参考:https://console.bce.baidu.com/iam/#/iam/apikey/list" "hint": "参考:[https://console.bce.baidu.com/iam/#/iam/apikey/list](https://console.bce.baidu.com/iam/#/iam/apikey/list)"
}, },
"web_search_link": { "web_search_link": {
"description": "显示来源引用" "description": "显示来源引用"
@@ -133,15 +136,15 @@
} }
} }
}, },
"sandbox": { "agent_computer_use": {
"description": "Agent 沙箱环境(Beta)", "description": "使用电脑能力",
"hint": "https://docs.astrbot.app/use/astrbot-agent-sandbox.html", "hint": "让 AstrBot 访问和使用你的电脑或者隔离的沙盒环境,以执行更复杂的任务。详见: [沙盒模式](https://docs.astrbot.app/use/astrbot-agent-sandbox.html), [Skills](https://docs.astrbot.app/use/skills.html)。",
"provider_settings": { "provider_settings": {
"computer_use_runtime": {
"description": "运行环境",
"hint": "sandbox 代表在沙箱环境中运行, local 代表在本地环境中运行, none 代表不启用。如果上传了 skills,选择 none 会导致其无法被 Agent 正常使用。"
},
"sandbox": { "sandbox": {
"enable": {
"description": "启用沙箱环境",
"hint": "启用后,Agent 可以使用沙箱环境中的工具和资源,如 Python 代码执行、Shell 等。"
},
"booter": { "booter": {
"description": "沙箱环境驱动器" "description": "沙箱环境驱动器"
}, },
@@ -164,21 +167,9 @@
} }
} }
}, },
"skills": {
"hint": "https://docs.astrbot.app/en/use/skills.html",
"description": "Skills",
"provider_settings": {
"skills": {
"runtime": {
"description": "Skill Runtime",
"hint": "选择 Skills 运行环境。使用 sandbox 前需启用沙箱;local 模式下 Agent 可通过 Shell 和 Python 功能完全访问运行环境,非管理员将被自动禁止使用以保证安全。"
}
}
}
},
"proactive_capability": { "proactive_capability": {
"description": "主动型 Agent", "description": "主动型能力",
"hint": "https://docs.astrbot.app/use/proactive-agent.html", "hint": "让 AstrBot 能够在某一时刻自动唤醒,帮你完成任务。详见: [主动型 Agent](https://docs.astrbot.app/use/proactive-agent.html)。",
"provider_settings": { "provider_settings": {
"proactive_capability": { "proactive_capability": {
"add_cron_tools": { "add_cron_tools": {
@@ -189,7 +180,7 @@
} }
}, },
"truncate_and_compress": { "truncate_and_compress": {
"hint": "https://docs.astrbot.app/use/context-compress.html", "hint": "AstrBot 如何管理工作记忆。详见: [上下文管理策略](https://docs.astrbot.app/use/context-compress.html)。",
"description": "上下文管理策略", "description": "上下文管理策略",
"provider_settings": { "provider_settings": {
"max_context_length": { "max_context_length": {
@@ -438,7 +429,7 @@
}, },
"emojis": { "emojis": {
"description": "表情列表(飞书表情枚举名)", "description": "表情列表(飞书表情枚举名)",
"hint": "表情枚举名参考:https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce" "hint": "表情枚举名参考:[https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce](https://open.feishu.cn/document/server-docs/im-v1/message-reaction/emojis-introduce)"
} }
} }
}, },
@@ -449,7 +440,7 @@
}, },
"emojis": { "emojis": {
"description": "表情列表(Unicode)", "description": "表情列表(Unicode)",
"hint": "Telegram 仅支持固定反应集合,参考:https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9" "hint": "Telegram 仅支持固定反应集合,参考:[https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9](https://gist.github.com/Soulter/3f22c8e5f9c7e152e967e8bc28c97fc9)"
} }
} }
} }
@@ -606,15 +597,15 @@
}, },
"pypi_index_url": { "pypi_index_url": {
"description": "PyPI 软件仓库地址", "description": "PyPI 软件仓库地址",
"hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 https://mirrors.aliyun.com/pypi/simple/" "hint": "安装 Python 依赖时请求的 PyPI 软件仓库地址。默认为 [https://mirrors.aliyun.com/pypi/simple/](https://mirrors.aliyun.com/pypi/simple/)"
}, },
"callback_api_base": { "callback_api_base": {
"description": "对外可达的回调接口地址", "description": "对外可达的回调接口地址",
"hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定外部服务如何访问 AstrBot 的地址。如 http://localhost:6185,https://example.com 等。" "hint": "外部服务可能会通过 AstrBot 生成的回调链接(如文件下载链接)访问 AstrBot 后端。由于 AstrBot 无法自动判断部署环境中对外可达的主机地址(host),因此需要通过此配置项显式指定外部服务如何访问 AstrBot 的地址。如 [http://localhost:6185](http://localhost:6185),[https://example.com](https://example.com) 等。"
}, },
"timezone": { "timezone": {
"description": "时区", "description": "时区",
"hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab" "hint": "时区设置。请填写 IANA 时区名称, 如 Asia/Shanghai, 为空时使用系统默认时区。所有时区请查看: [https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab](https://data.iana.org/time-zones/tzdb-2021a/zone1970.tab)"
}, },
"http_proxy": { "http_proxy": {
"description": "HTTP 代理", "description": "HTTP 代理",
@@ -210,7 +210,8 @@
"deleteTitle": "删除确认", "deleteTitle": "删除确认",
"deleteMessage": "确定要删除该 Skill 吗?", "deleteMessage": "确定要删除该 Skill 吗?",
"deleteSuccess": "删除成功", "deleteSuccess": "删除成功",
"deleteFailed": "删除失败" "deleteFailed": "删除失败",
"runtimeNoneWarning": "Computer Use 运行环境为无,Skills 可能无法正确被 Agent 运行,因为没有启用运行环境。"
}, },
"card": { "card": {
"actions": { "actions": {
@@ -49,6 +49,7 @@
"loadingSkills": "正在加载 Skills...", "loadingSkills": "正在加载 Skills...",
"allSkillsAvailable": "使用所有可用 Skills", "allSkillsAvailable": "使用所有可用 Skills",
"noSkillsSelected": "未选择任何 Skills", "noSkillsSelected": "未选择任何 Skills",
"skillsRuntimeNoneWarning": "Computer Use 运行环境为无,Skills 可能无法正确被 Agent 运行,因为没有启用运行环境。",
"createInFolder": "将在「{folder}」中创建", "createInFolder": "将在「{folder}」中创建",
"rootFolder": "全部人格" "rootFolder": "全部人格"
}, },