# AI 陪练

# 获取陪练场景列表

# 接口调用说明

GET https://lxapi.lexiangla.com/cgi-bin/v1/ai-trains?limit=100&status=published&page=1

# 请求数据编码格式

Content-Type: application/json

# 参数说明

参数 是否必须 默认值 说明
limit 每页个数限制为1 ~ 200
status 陪练状态;draft 草稿状态、published 发布状态
page 分页页码
title_like 支持场景名称模糊匹配过滤
# 200 OK 状态码
{
  "data": [
    {
      "type": "ai_train",
      "id": "525b258cad4048b3917xxxxxxxxxxx",
      "attributes": {
        "created_from": "team",
        "is_from_roadmap": true,
        "title": "k吧AI陪练",
        "status": "published",
        "source": "manual",
        "created_at": "2025-06-04 17:25:52"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "staff",
            "id": "LX001"
          }
        },
        "category": {
          "data": {
            "type": "category",
            "id": "089faf08354211f0xxxxxxxxxxx"
          }
        },
        "team": {
          "data": {
            "type": "team",
            "id": "f4d0338e163f11eabb7a02xxxxxxxxx"
          }
        }
      }
    }
  ],
  "links": {
    "first": "https://lxapi.lexiangla.net/cgi-bin/v1/ai-trains?lxxxxxxxxxxxxxxxx",
    "last": "https://lxapi.lexiangla.net/cgi-bin/v1/ai-trains?lxxxxxxxxxxxxxxxx",
    "prev": "https://lxapi.lexiangla.net/cgi-bin/v1/ai-trains?lxxxxxxxxxxxxxxxx",
    "next": "https://lxapi.lexiangla.net/cgi-bin/v1/ai-trains?lxxxxxxxxxxxxxxxx"
  },
  "meta": {
    "current_page": 2,
    "from": 2,
    "last_page": 356,
    "path": "https://lxapi.lexiangla.net/cgi-bin/v1/xxxxxxxxx",
    "per_page": 1,
    "to": 2,
    "total": 356
  },
  "included": [
    {
      "type": "staff",
      "id": "LX001",
      "attributes": {
        "name": "张三(示例)",
        "english_name": null,
        "organization": "腾讯公司\\产品部\\产品一组"
      }
    },
    {
      "type": "category",
      "id": "089faf08354211f0xxxxxxxxxxx",
      "attributes": {
        "name": "我的分类",
        "weight": 0
      }
    },
    {
      "type": "team",
      "id": "f4d0338e163f11eabb7a02xxxxxxxxx",
      "attributes": {
        "code": "k100001",
        "name": "示例K吧",
        "type": 2,
        "logo": null,
        "signature": "",
        "is_secret": 1,
        "application": [
          "knowledge",
          "event",
          "survey",
          "course"
        ]
      },
      "links": {
        "platform": "http://km.lx.net/teams/k100001"
      }
    }
  ]
}
# 400 Bad Request 状态码
{
  "errors": [
    {
      "detail": "{\"status\":[\"不能为空\"],\"status\":[\"选定的 status 是无效的.\"]}"
    }
  ]
}
{
  "errors": [
    {
      "detail": "{\"limit\":[\"不能为空\"],\"limit\":[\"limit 必须在 1 和 200 之间.\"]}"
    }
  ]
}
# 响应字段说明

参数说明:

参数 说明
id 场景ID
attributes.created_from 创建入口,platform 表示平台,team 表示k吧
attributes.is_from_roadmap 是否来源项目,
attributes.title 场景名称
attributes.status 状态,draft表示草稿状态、published表示发布状态
attributes.source manual 表示通用场景,medicine_recommend 表示探需推介场景,prompt 表示提示词模式
attributes.created_at 创建时间
relationships.owner.data.id 创建人账号id
relationships.category.data.id 陪练所属分类id
relationships.team.data.id 陪练所属K吧id
included[0].attributes.name 创建人姓名
included[0].attributes.english_name 创建人英文名
included[0].attributes.organization 创建人所属部门
included[1].attributes.name 陪练所属分类名称
included[1].attributes.weight 陪练所属分类权重
included[2].attributes.code 陪练所属K吧code
included[2].attributes.name 陪练所属K吧名称
included[2].attributes.type 陪练所属K吧应用场景。知识沉淀:2,项目管理:3,type:4,自定义:1
included[2].attributes.logo 陪练所属K吧logo
included[2].attributes.signature 陪练所属K吧介绍
included[2].attributes.is_secret 陪练所属K吧是否保密
included[2].attributes.application 陪练所属K吧已开启的应用。 knowledge: 文档, event: 活动, album: 相册, survey: 问卷, exam: 考试, course: 课堂, liveroom: 直播, share: 轻享, roadmap: 项目, collection: 文集

# 获取单个陪练任务详情

# 接口调用说明

GET https://lxapi.lexiangla.com/cgi-bin/v1/ai-trains/{id}

# 请求数据编码格式

Content-Type: application/json

# 参数说明

参数 是否必须 默认值 说明
id 场景id
# 200 OK 状态码
{
  "data": {
    "type": "ai_train",
    "id": "737aa5423f4f473e9c6c5d462xxxxxxx",
    "attributes": {
      "created_from": "platform",
      "is_from_roadmap": true,
      "title": " 标题测试 123",
      "status": "published",
      "source": "manual",
      "created_at": "2025-06-16 11:11:26",
      "staff_count": 62,
      "finished_staff_count": 0
    },
    "relationships": {
      "owner": {
        "data": {
          "type": "staff",
          "id": "LX001"
        }
      },
      "category": {
        "data": {
          "type": "category",
          "id": "089faf08354211f0xxxxxxxxxxx"
        }
      },
      "team": {
        "data": {
          "type": "team",
          "id": "f4d0338e163f11eabbxxxxxxxxxxx"
        }
      }
    }
  },
  "included": [
    {
      "type": "staff",
      "id": "LX001",
      "attributes": {
        "name": "张三(示例)",
        "english_name": null,
        "organization": "腾讯公司\\产品部\\产品一组"
      }
    },
    {
      "type": "category",
      "id": "089faf08354211f0xxxxxxxxxxx",
      "attributes": {
        "name": "我的分类",
        "weight": 0
      }
    },
    {
      "type": "team",
      "id": "f4d0338e163f11eabbxxxxxxxxxxx",
      "attributes": {
        "code": "k100001",
        "name": "示例K吧",
        "type": 2,
        "logo": null,
        "signature": "",
        "is_secret": 1,
        "application": [
          "knowledge",
          "event",
          "survey",
          "course"
        ]
      },
      "links": {
        "platform": "http://km.lx.net/teams/k100001"
      }
    }
  ]
}

# 响应字段说明

参数说明:

参数 说明
attributes.created_from 创建入口,platform 表示平台,team 表示k吧
attributes.is_from_roadmap 是否来源项目,
attributes.title 场景名称
attributes.status 状态,draft表示草稿状态、published表示发布状态
attributes.source manual 表示通用场景,medicine_recommend 表示探需推介场景,prompt 表示提示词模式
attributes.created_at 创建时间
attributes.staff_count 练习总人数
attributes.finished_staff_count 已完成人数
relationships.owner.data.id 创建人账号id
relationships.category.data.id 陪练所属分类id
relationships.team.data.id 陪练所属K吧id
included[0].attributes.name 创建人姓名
included[0].attributes.english_name 创建人英文名
included[0].attributes.organization 创建人所属部门
included[1].attributes.name 陪练所属分类名称
included[1].attributes.weight 陪练所属分类权重
included[2].attributes.code 陪练所属K吧code
included[2].attributes.name 陪练所属K吧名称
included[2].attributes.type 陪练所属K吧应用场景。知识沉淀:2,项目管理:3,type:4,自定义:1
included[2].attributes.logo 陪练所属K吧logo
included[2].attributes.signature 陪练所属K吧介绍
included[2].attributes.is_secret 陪练所属K吧是否保密
included[2].attributes.application 陪练所属K吧已开启的应用。 knowledge: 文档, event: 活动, album: 相册, survey: 问卷, exam: 考试, course: 课堂, liveroom: 直播, share: 轻享, roadmap: 项目, collection: 文集