1. 创建模板

1.1. 调用地址

https://api.regenai.com/v1/platform/build_docs

1.2. 请求方式

POST

1.3. 请求数据类型

application/json

1.4. 返回类型

JSON

1.5. 请求URL参数

名称 变量名 必填 类型 示例值 描述
Key app_key true String c5ed72329fece2fe0010a437505b01cb 用户级别app key, 在平台账户详情中查看
令牌 token true String 7007bd1257dce8d47489166a7c77a926 授权令牌
时间戳 timestamp true String 1522374165 timestamp 为January 1 1970 00:00:00 GMT 到现在的秒数

1.6. 请求Body参数:

{
    "name": "test_docs",       //模型标识
    "description": "测试文档名称2",   //模型名称
    "description_details": "测试文档名称详情2",    //模型描述
    "fields": [{                                  //字段
            "name": "bank_account",           //字段标识
            "type": "text",                     //字段类型  text  文本  table 表格
            "description": "开户行"
        }, {
            "name": "amount",
            "type": "text",
            "description": "金额"
        }, {
            "name": "item_name",
            "type": "table",
            "description": "项目名称",
            "group": "test_items"               //所属表格名称
        }, {
            "name": "price",
            "type": "table",
            "description": "单价",
            "group": "test_items"
        }
    ],
    "prompt_id": 116,                 //指令ID
    "engine_param": "RegenLLM_Base_ES",       //引擎参数
    "tables": [{                                //表格
            "name": "test_items",              //表格名称
            "description": "明细表"            //表格描述
        }
    ],
    "samples": [{                             //样本
            "data": "XXX",                  //样本Base64数据
            "keyword": "电子发票"           //分类关键词
        }
    ]
}

1.7. 请求说明

  • token 的值计算方式为:md5($appkey+$timestamp+$appSecret)
    • token=md5("c5ed72329fece2fe0010a437505b01cb+1522374165+5c9597f3c8245907ea71a89d9d39d08e")=7007bd1257dce8d47489166a7c77a926
  • 生成token时,字符串连接中的“+”是必需的,缺少这个符号会无法验证通过验证

1.8. 返回值

1.8.1. 正确返回参数

名称 变量名 必填 类型 示例值 描述
返回状态码 result true int 0或1 请求状态. 1:成功, 0:失败
回复 response true json    

1.8.2. 正确返回样例

{
    "id": "648d55d4537f487e870f101536bb2ea4",
    "result": 1,
    "message": "success",
    "response": {
        "data": {
                "name": "docs_name",   -- 模板标识
                "type": 1000037,       -- 模板类型
                "description": "护士执业证书",   --模板名称
                "description_details": "",       --模板描述
                "enable": "enable",              -- 启用状态  disable: 禁用  enbale : 启用
                "status": "need_update",         -- 模板状态  not_available: 待训练   training:训练中  serving:服务中 need_update  待训练
                "docs_type": "default",          -- 模板类型  default:默认  prebuild: 平台预制
                "language": "cn",                -- 模板语言
                "fields": [{                     -- 定义字段
                        "name": "name",          -- 字段名称 返回json做为key
                        "description": "姓名",   -- 字段描述
                        "type": "text",          -- 字段类型   text: 字符串类型    table:表格类型
                        "attribute": "critical"  -- 字段属性     normal : 普通   critical: 关键字段
                    }
                ]
            }
    }
}

2. 查看模板

2.1. 调用地址

https://api.regenai.com/v1/platform/list_docs

2.2. 请求方式

POST

2.3. 请求数据类型

multipart/form-data

2.4. 返回类型

JSON

2.5. 请求URL参数

名称 变量名 必填 类型 示例值 描述
Key app_key true String c5ed72329fece2fe0010a437505b01cb 用户级别app key, 在平台账户详情中查看
令牌 token true String 7007bd1257dce8d47489166a7c77a926 授权令牌
时间戳 timestamp true String 1522374165 timestamp 为January 1 1970 00:00:00 GMT 到现在的秒数
页码 page true int 1
每页大小 page_size true int 10
查询类型 query_type true String SELF_BUILD PLATFORM_BUILD 所有平台预制模板
SELF_BUILD 自建模板
AUTHED_BUILD 被授权模板

2.6. 请求说明

  • token 的值计算方式为:md5($appkey+$timestamp+$appSecret)
    • token=md5("c5ed72329fece2fe0010a437505b01cb+1522374165+5c9597f3c8245907ea71a89d9d39d08e")=7007bd1257dce8d47489166a7c77a926
  • 生成token时,字符串连接中的“+”是必需的,缺少这个符号会无法验证通过验证

2.7. 返回值

2.7.1. 正确返回参数

名称 变量名 必填 类型 示例值 描述
返回状态码 result true int 0或1 请求状态. 1:成功, 0:失败
回复 response true json    

2.7.2. 正确返回样例

{
    "id": "648d55d4537f487e870f101536bb2ea4",
    "result": 1,
    "message": "success",
    "response": {
        "list": [{
                "name": "docs_name",   -- 模板标识
                "type": 1000037,       -- 模板类型
                "description": "护士执业证书",   --模板名称
                "description_details": "",       --模板描述
                "enable": "enable",              -- 启用状态  disable: 禁用  enbale : 启用
                "status": "need_update",         -- 模板状态  not_available: 待训练   training:训练中  serving:服务中 need_update  待训练
                "docs_type": "default",          -- 模板类型  default:默认  prebuild: 平台预制
                "language": "cn",                -- 模板语言
                "fields": [{                     -- 定义字段
                        "name": "name",          -- 字段名称 返回json做为key
                        "description": "姓名",   -- 字段描述
                        "type": "text",          -- 字段类型   text: 字符串类型    table:表格类型
                        "attribute": "critical"  -- 字段属性     normal : 普通   critical: 关键字段
                    }
                ]
            }
        ],
        "count": 26,
        "next_url": ""
    }
}

results matching ""

    No results matching ""