更新拆套配置
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"workspace_id": "2081651727503572992",
"scope": "workspace",
"rule_mode": "custom",
"rule_order": [
"page_reset",
"llm_judge"
]
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update"
payload = {
"workspace_id": "2081651727503572992",
"scope": "workspace",
"rule_mode": "custom",
"rule_order": ["page_reset", "llm_judge"]
}
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<api-key>',
'x-ti-secret-code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workspace_id: '2081651727503572992',
scope: 'workspace',
rule_mode: 'custom',
rule_order: ['page_reset', 'llm_judge']
})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => '2081651727503572992',
'scope' => 'workspace',
'rule_mode' => 'custom',
'rule_order' => [
'page_reset',
'llm_judge'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <api-key>",
"x-ti-secret-code: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update"
payload := strings.NewReader("{\n \"workspace_id\": \"2081651727503572992\",\n \"scope\": \"workspace\",\n \"rule_mode\": \"custom\",\n \"rule_order\": [\n \"page_reset\",\n \"llm_judge\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"2081651727503572992\",\n \"scope\": \"workspace\",\n \"rule_mode\": \"custom\",\n \"rule_order\": [\n \"page_reset\",\n \"llm_judge\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": \"2081651727503572992\",\n \"scope\": \"workspace\",\n \"rule_mode\": \"custom\",\n \"rule_order\": [\n \"page_reset\",\n \"llm_judge\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"result": {
"workspace_id": "2081651727503572992",
"scope": "workspace",
"rule_mode": "custom",
"rule_order": [
"page_reset",
"llm_judge"
],
"constraint": "none",
"llm_prompt_mode": "default"
}
}拆套配置
更新拆套配置
更新指定空间或类别的拆套规则、约束和提示词。
POST
/
api
/
app-api
/
sip
/
platform
/
v2
/
split-config
/
update
更新拆套配置
curl --request POST \
--url https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update \
--header 'Content-Type: application/json' \
--header 'x-ti-app-id: <api-key>' \
--header 'x-ti-secret-code: <api-key>' \
--data '
{
"workspace_id": "2081651727503572992",
"scope": "workspace",
"rule_mode": "custom",
"rule_order": [
"page_reset",
"llm_judge"
]
}
'import requests
url = "https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update"
payload = {
"workspace_id": "2081651727503572992",
"scope": "workspace",
"rule_mode": "custom",
"rule_order": ["page_reset", "llm_judge"]
}
headers = {
"x-ti-app-id": "<api-key>",
"x-ti-secret-code": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-ti-app-id': '<api-key>',
'x-ti-secret-code': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
workspace_id: '2081651727503572992',
scope: 'workspace',
rule_mode: 'custom',
rule_order: ['page_reset', 'llm_judge']
})
};
fetch('https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workspace_id' => '2081651727503572992',
'scope' => 'workspace',
'rule_mode' => 'custom',
'rule_order' => [
'page_reset',
'llm_judge'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ti-app-id: <api-key>",
"x-ti-secret-code: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update"
payload := strings.NewReader("{\n \"workspace_id\": \"2081651727503572992\",\n \"scope\": \"workspace\",\n \"rule_mode\": \"custom\",\n \"rule_order\": [\n \"page_reset\",\n \"llm_judge\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-ti-app-id", "<api-key>")
req.Header.Add("x-ti-secret-code", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update")
.header("x-ti-app-id", "<api-key>")
.header("x-ti-secret-code", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"2081651727503572992\",\n \"scope\": \"workspace\",\n \"rule_mode\": \"custom\",\n \"rule_order\": [\n \"page_reset\",\n \"llm_judge\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://docflow.textin.com/api/app-api/sip/platform/v2/split-config/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ti-app-id"] = '<api-key>'
request["x-ti-secret-code"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workspace_id\": \"2081651727503572992\",\n \"scope\": \"workspace\",\n \"rule_mode\": \"custom\",\n \"rule_order\": [\n \"page_reset\",\n \"llm_judge\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"result": {
"workspace_id": "2081651727503572992",
"scope": "workspace",
"rule_mode": "custom",
"rule_order": [
"page_reset",
"llm_judge"
],
"constraint": "none",
"llm_prompt_mode": "default"
}
}请求体
application/json
工作空间 ID。调用方需要 WORKSPACE_CONFIG 权限及该空间的访问权限。
配置范围:workspace 表示空间,category 表示类别。当 scope 为 category 时,必须同时传入 category_id。
可用选项:
workspace, category 规则来源:空间支持 default(系统默认)和 custom(自定义);类别支持 inherit(跟随空间)和 custom(自定义)。 类别选择 inherit 时,使用空间的规则和提示词,但 constraint 仍使用类别自己的设置。
可用选项:
default, inherit, custom 本级保存的规则,按数组顺序从前到后排列优先级。default/inherit 模式传空数组;custom 模式允许 0–7 条,不能重复。继承模式不在此展开空间规则。
Maximum array length:
7拆套规则代码。llm_judge 表示由模型判断页面连续性;提示词通过 llm_prompt_mode 和 llm_prompt 配置。
可用选项:
page_same, page_reset, invoice_diff, invoice_same, page_seq, table_continue, llm_judge 类别 ID;scope=category 时必填,且必须属于指定空间;scope=workspace 时不要传入。
类别的拆套约束:none 不限制;strict_single_page 每份文档严格单页;strict_multi_page 每份文档严格多页;strict_once 该类别只出现一份文档。空间级仅支持 none。
可用选项:
none, strict_single_page, strict_multi_page, strict_once llm_judge 规则的提示词来源:default 使用系统默认提示词;custom 使用 llm_prompt。它不是一条拆套规则。
可用选项:
default, custom llm_judge 的自定义提示词,例如“结合标题和上下文判断相邻页是否属于同一份文档”。启用该规则且 llm_prompt_mode=custom 时,内容不能是空白。

