用途:该技能用于从模板新建一个 ibl.ai 智能体,是配置智能体之前的第一步:创建后会返回 unique_id,再交给 /iblai-agent-* 系列技能(settings、llm、prompts、datasets 等)继续配置。若要复制已有智能体而非从模板开始,应使用 /iblai-agent-settings 的 fork 功能。
认证与约定:基础 URL 为 https://api.iblai.app;每个请求需带请求头 Authorization: Api-Token $IBLAI_API_KEY。路径变量 {org} = $IBLAI_ORG,{username} = $IBLAI_USERNAME。若尚未连接,先运行 /iblai-login 以填充 IBLAI_ORG、IBLAI_USERNAME 和 IBLAI_API_KEY。
读取接口:GET https://api.iblai.app/dm/api/search/orgs/{org}/users/{username}/mentors/ 用于列出组织内已有智能体,便于选择 fork 来源或确认名称是否可用;GET https://api.iblai.app/dm/api/ai-mentor/orgs/{org}/users/{username}/mentor/categories/ 用于获取分类选项,创建后可通过 /iblai-agent-settings 分配。
写入接口:POST https://api.iblai.app/dm/api/ai-mentor/orgs/{org}/users/{username}/mentor-with-settings/,从模板创建新智能体并返回其 unique_id 及创建结果。请求体字段:template_name(字符串,必填,例如 ai-mentor)、new_mentor_name(字符串,必填)、display_name、description、system_prompt、llm_provider。
示例:curl -X POST "https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentor-with-settings/" -H "Authorization: Api-Token $IBLAI_API_KEY" -H "Content-Type: application/json" -d '{"template_name": "ai-mentor", "new_mentor_name": "Data Science Tutor", "description": "Helps users with statistics and Python."}' 响应中包含 unique_id,可作为其他技能中的 {mentor} 使用。
说明与限制:多数组织中 template_name 默认为 ai-mentor,创建调用接受该组织暴露的任意模板。创建刻意保持精简,只设置名称和少量字段,其余通过 /iblai-agent-settings、/iblai-agent-llm、/iblai-agent-prompts、/iblai-agent-datasets、/iblai-agent-tools 等聚焦技能配置,并使用返回的 unique_id 作为 {mentor}。如需复制已有智能体而非从模板开始,请使用 /iblai-agent-settings 中的 fork 端点。