[AI66-10]FTO Search - Generate Report
Generates the FTO report, exports a Word document and uploads it to S3. When the CC results are omitted, all persisted results are read back by task_id; the technical feature, keyword expansion and query sections in the Word file are marked pending when their inputs are missing. Observed timing: about 37 seconds for 150 patents' complete CC results. POST returns running immediately; poll GET /fto_steps/report_generation/{task_id} for the result.
Request Parameters
List of parameters supported by this API endpoint
| Name | Type | Example | Description |
|---|---|---|---|
| string | fto-20260928-a1b2c3d4 | Task ID. Auto-generated as fto-{yyyymmdd}-{8-hex} on first call when omitted (same format as resolve_task_id in app/fto_mcp/context.py). Later steps must reuse the same task_id to read upstream artifacts. |
| string | cn | Language of the user input: cn (Chinese) / en (English). When omitted, reads back the input_lang persisted by create_task under the same task_id, defaulting to cn if still unavailable. |
| string | 一种折叠屏电子设备的转轴结构,包括壳体、同步旋转机构与快拆锁定件…… | Technical proposal description. When omitted, it is read back by task_id from a prior artifact (usually the refined result of proposal_refine, or an earlier raw proposal already persisted). Returns 422 when neither is available. |
| array | [
{
"success": true,
"patent_id": "57821030-e8f0-4cd3-8c28-1b1c485133e6",
"conclusion": "该专利权利要求1覆盖本方案全部核心特征,存在较高侵权风险。",
"claim_risks": [],
"risk_assessment": {
"infringement_risk_level": "HIGH"
},
"analysis_success": true,
"include_in_report": true,
"feature_comparisons": [],
"total_features_count": 6,
"public_features_count": 2
}
] | Claim comparison results, taken from claim_analysis_results of cc_analysis / feature_comparison. When omitted, all accumulated batches are read back by task_id (requires cc_analysis or feature_comparison to have run first). When neither input nor history is available, short-circuits to an empty report (success=true, claim_analysis_results=[]) without generating the Word file or uploading to S3. |
| object | {
"search_elements": [
{
"element_type": "CORE_INNOVATION",
"keyword_type": "STRUCTURAL",
"relevance_score": 0.95,
"element_description": "亲肤层的边缘形成沿侧边延伸的凸起或褶皱防漏隔边……"
}
]
} | Feature extraction result from feature_extraction. The matching Word section is marked pending when omitted. |
| object | {
"tech_field": {},
"tech_features": []
} | Keyword expansion result from keyword_expansion. The matching Word section is marked pending when omitted. |
| array | [
{
"query": "TAC_ALL:(防漏隔边 OR 防漏侧边)",
"sequence": "S1",
"actual_query": "TAC_ALL:(防漏隔边 OR 防漏侧边)",
"is_available": true,
"result_count": 18624,
"is_combination": false
}
] | Query list from query_generation. The matching Word section is marked pending when omitted. |
| array | [
"CN"
] | List of patent authorities, rendered in the Word report's search-scope section. When omitted, reads back user_input_filter.country. |
| array | [
"1",
"2"
] | Legal status list of strings, rendered in the Word report's search-scope section. When omitted, reads back user_input_filter.legal_status (normalized to strings). |
| string | 2020-01-01 | Start date (application/publication date filter, format YYYY-MM-DD). When omitted, reads back user_input_filter.apd_start. |
| string | 2023-12-31 | End date (application/publication date filter, format YYYY-MM-DD). When omitted, reads back user_input_filter.apd_end. |
Response Schema
Structure of the API response data
| Field Name | Type | Example | Description |
|---|---|---|---|
statusRequired | string | running | Status right after submission, always running; the actual execution happens in the background, poll with GET for the terminal state. |
task_idRequired | string | fto-20260928-a1b2c3d4 | Task ID; when the request body omits it, this is the value generated for this call. Later steps must carry it to continue the chain. |
step_nameRequired | string | proposal_refine | The submitted step name, matching the URL path. |
Success Response Example
Example of a successful API response
JSON
{
"status": true,
"task_id": "fto-20260928-a1b2c3d4",
"step_name": "proposal_refine",
"error_code": 0
}Error Codes
List of possible error codes returned by this endpoint
Business Errors
| Error Code | Description |
|---|---|
68300004 | Invalid parameter! |
68300005 | Search api failure! |
68300006 | Analytic basic access error! |
68300007 | Bad request! |
68300008 | Service error, please try again later! |
68300010 | The file does not comply with upload specifications! |
Platform Errors
| Error Code | Description |
|---|---|
67200000 | API call exceeds the total limit set by the platform! |
67200001 | API call exceeds the total limit set by the platform! |
67200002 | The current call rate is too fast, exceeding the current configuration limit QPS! |
67200003 | The key and secret parameters for applying for the token are incorrect or the client has been disabled! |
67200004 | The requested api does not have permission. Please contact our support personnel! |
67200005 | Insufficient account balance/number of calls! |
67200006 | The client has exceeded the activation validity period! |
67200007 | The current call exceeds the configured usage limit of the day! |
67200008 | Please check if the required apikey in the query parameter has been transmitted! |
67200009 | The apikey does not match the passed bearerToken. Please check if a valid token is being used! |
67200012 | The request is illegal! |
67200100 | The current server status is busy, request response timeout! |
67200101 | The API requested currently does not exist. Please check the request path! |
HTTP Status Codes
| Status Code | Description |
|---|---|
0 | Success |
422 | Validation Error |
409 | 同一 task_id 已有步骤正在运行 |