Skip to main content
POST
更新拆套配置

授权

x-ti-app-id
string
header
必填
x-ti-secret-code
string
header
必填

请求体

application/json
workspace_id
string
必填

工作空间 ID。调用方需要 WORKSPACE_CONFIG 权限及该空间的访问权限。

scope
enum<string>
必填

配置范围:workspace 表示空间,category 表示类别。当 scope 为 category 时,必须同时传入 category_id。

可用选项:
workspace,
category
rule_mode
enum<string>
必填

规则来源:空间支持 default(系统默认)和 custom(自定义);类别支持 inherit(跟随空间)和 custom(自定义)。 类别选择 inherit 时,使用空间的规则和提示词,但 constraint 仍使用类别自己的设置。

可用选项:
default,
inherit,
custom
rule_order
enum<string>[]
必填

本级保存的规则,按数组顺序从前到后排列优先级。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
category_id
string

类别 ID;scope=category 时必填,且必须属于指定空间;scope=workspace 时不要传入。

constraint
enum<string>
默认值:none

类别的拆套约束:none 不限制;strict_single_page 每份文档严格单页;strict_multi_page 每份文档严格多页;strict_once 该类别只出现一份文档。空间级仅支持 none。

可用选项:
none,
strict_single_page,
strict_multi_page,
strict_once
llm_prompt_mode
enum<string>
默认值:default

llm_judge 规则的提示词来源:default 使用系统默认提示词;custom 使用 llm_prompt。它不是一条拆套规则。

可用选项:
default,
custom
llm_prompt
string | null

llm_judge 的自定义提示词,例如“结合标题和上下文判断相邻页是否属于同一份文档”。启用该规则且 llm_prompt_mode=custom 时,内容不能是空白。

响应

请求成功时,code 为 200,result 返回拆套配置;请求失败时,code 返回错误码,msg 说明失败原因。

code
integer<int64>
必填

业务状态码:200 表示成功,其他值表示失败。

示例:

200

msg
string
必填

响应说明;失败时说明具体原因。

示例:

"success"

result
object | null

成功时返回当前空间或类别保存的拆套配置;失败时为空或不返回。