refactor(api): migrate console/service_api.dataset.document to BaseModel (#36506)

Co-authored-by: WH-2099 <wh2099@pm.me>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
chariri
2026-05-30 14:38:27 +00:00
committed by GitHub
co-authored by WH-2099 autofix-ci[bot]
parent 6805d9bfc0
commit 599960024d
17 changed files with 1412 additions and 611 deletions
+30 -20
View File
@@ -4792,9 +4792,9 @@ Get dataset auto disable logs
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Success |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Indexing status retrieved successfully | [DocumentStatusListResponse](#documentstatuslistresponse) |
### /datasets/{dataset_id}/documents
@@ -4830,9 +4830,9 @@ Get documents in a dataset
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Documents retrieved successfully |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Documents retrieved successfully | [DocumentWithSegmentsListResponse](#documentwithsegmentslistresponse) |
#### POST
##### Parameters
@@ -5028,10 +5028,10 @@ Get document indexing status
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Indexing status retrieved successfully |
| 404 | Document not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Indexing status retrieved successfully | [DocumentStatusResponse](#documentstatusresponse) |
| 404 | Document not found | |
### /datasets/{dataset_id}/documents/{document_id}/metadata
@@ -11432,7 +11432,7 @@ Enum class for api provider schema type.
| description | string | | Yes |
| id | string | | Yes |
| name | string | | Yes |
| parameters | | | Yes |
| parameters | object<br>[ object ]<br>string | | Yes |
| server_code | string | | Yes |
| status | [AppMCPServerStatus](#appmcpserverstatus) | | Yes |
| updated_at | integer | | No |
@@ -11903,7 +11903,7 @@ Condition detail
| ---- | ---- | ----------- | -------- |
| comparison_operator | string | *Enum:* `"<"`, `"="`, `">"`, `"after"`, `"before"`, `"contains"`, `"empty"`, `"end with"`, `"in"`, `"is"`, `"is not"`, `"not contains"`, `"not empty"`, `"not in"`, `"start with"`, `"≠"`, `"≤"`, `"≥"` | Yes |
| name | string | | Yes |
| value | | | No |
| value | string<br>[ string ]<br>integer<br>number | | No |
#### ConsoleDatasetListQuery
@@ -12820,7 +12820,7 @@ Request payload for bulk downloading documents as a zip archive.
| id | string | | Yes |
| name | string | | Yes |
| type | string | | Yes |
| value | string | | No |
| value | string<br>integer<br>number<br>boolean | | No |
#### DocumentMetadataUpdatePayload
@@ -12844,14 +12844,14 @@ Request payload for bulk downloading documents as a zip archive.
| created_by | string | | No |
| created_from | string | | No |
| data_source_detail_dict | | | No |
| data_source_info_dict | | | No |
| data_source_info | | | No |
| data_source_type | string | | No |
| dataset_process_rule_id | string | | No |
| disabled_at | integer | | No |
| disabled_by | string | | No |
| display_status | string | | No |
| doc_form | string | | No |
| doc_metadata_details | [ [DocumentMetadataResponse](#documentmetadataresponse) ] | | No |
| doc_metadata | [ [DocumentMetadataResponse](#documentmetadataresponse) ] | | No |
| enabled | boolean | | No |
| error | string | | No |
| hit_count | integer | | No |
@@ -12893,6 +12893,16 @@ Request payload for bulk downloading documents as a zip archive.
| stopped_at | integer | | Yes |
| total_segments | integer | | No |
#### DocumentWithSegmentsListResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| data | [ [DocumentWithSegmentsResponse](#documentwithsegmentsresponse) ] | | Yes |
| has_more | boolean | | Yes |
| limit | integer | | Yes |
| page | integer | | Yes |
| total | integer | | Yes |
#### DocumentWithSegmentsResponse
| Name | Type | Description | Required |
@@ -12903,14 +12913,14 @@ Request payload for bulk downloading documents as a zip archive.
| created_by | string | | No |
| created_from | string | | No |
| data_source_detail_dict | | | No |
| data_source_info_dict | | | No |
| data_source_info | | | No |
| data_source_type | string | | No |
| dataset_process_rule_id | string | | No |
| disabled_at | integer | | No |
| disabled_by | string | | No |
| display_status | string | | No |
| doc_form | string | | No |
| doc_metadata_details | [ [DocumentMetadataResponse](#documentmetadataresponse) ] | | No |
| doc_metadata | [ [DocumentMetadataResponse](#documentmetadataresponse) ] | | No |
| enabled | boolean | | No |
| error | string | | No |
| hit_count | integer | | No |
@@ -14000,7 +14010,7 @@ Enum class for large language model mode.
| ---- | ---- | ----------- | -------- |
| id | string | | Yes |
| name | string | | Yes |
| value | | | No |
| value | string<br>integer<br>number | | No |
#### MetadataFilteringCondition
@@ -14595,7 +14605,7 @@ Form input definition.
| ---- | ---- | ----------- | -------- |
| current_identifier | string | | No |
| type | [Type](#type) | | Yes |
| value | | | Yes |
| value | [Github](#github)<br>[Marketplace](#marketplace)<br>[Package](#package) | | Yes |
#### PluginEndpointListResponse
@@ -15130,7 +15140,7 @@ Form input definition.
| description | string | | No |
| icon | string | | No |
| icon_background | string | | No |
| icon_type | | | No |
| icon_type | string<br>[IconType](#icontype) | | No |
| privacy_policy | string | | No |
| prompt_public | boolean | | No |
| show_workflow_steps | boolean | | No |
+153 -61
View File
@@ -753,15 +753,17 @@ Create a new document by uploading a file
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| data | formData | Optional JSON string with document creation settings. | No | string |
| file | formData | Document file to upload. | Yes | file |
| dataset_id | path | Dataset ID | Yes | string |
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document created successfully |
| 400 | Bad request - invalid file or parameters |
| 401 | Unauthorized - invalid API token |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document created successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 400 | Bad request - invalid file or parameters | |
| 401 | Unauthorized - invalid API token | |
### /datasets/{dataset_id}/document/create-by-text
@@ -779,11 +781,11 @@ Create a new document by providing text content
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document created successfully |
| 400 | Bad request - invalid parameters |
| 401 | Unauthorized - invalid API token |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document created successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 400 | Bad request - invalid parameters | |
| 401 | Unauthorized - invalid API token | |
### /datasets/{dataset_id}/document/create_by_file
@@ -796,15 +798,17 @@ Create a new document by uploading a file
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| data | formData | Optional JSON string with document creation settings. | No | string |
| file | formData | Document file to upload. | Yes | file |
| dataset_id | path | Dataset ID | Yes | string |
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document created successfully |
| 400 | Bad request - invalid file or parameters |
| 401 | Unauthorized - invalid API token |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document created successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 400 | Bad request - invalid file or parameters | |
| 401 | Unauthorized - invalid API token | |
### /datasets/{dataset_id}/document/create_by_text
@@ -823,11 +827,11 @@ Deprecated legacy alias for creating a new document by providing text content. U
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document created successfully |
| 400 | Bad request - invalid parameters |
| 401 | Unauthorized - invalid API token |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document created successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 400 | Bad request - invalid parameters | |
| 401 | Unauthorized - invalid API token | |
### /datasets/{dataset_id}/documents
@@ -841,14 +845,18 @@ List all documents in a dataset
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| dataset_id | path | Dataset ID | Yes | string |
| keyword | query | Search keyword | No | string |
| limit | query | Number of items per page | No | integer |
| page | query | Page number | No | integer |
| status | query | Document status filter | No | string |
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Documents retrieved successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Dataset not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Documents retrieved successfully | [DocumentListResponse](#documentlistresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Dataset not found | |
### /datasets/{dataset_id}/documents/download-zip
@@ -956,11 +964,11 @@ Get indexing status for documents in a batch
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Indexing status retrieved successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Dataset or documents not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Indexing status retrieved successfully | [DocumentStatusListResponse](#documentstatuslistresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Dataset or documents not found | |
### /datasets/{dataset_id}/documents/{document_id}
@@ -1019,16 +1027,18 @@ Update an existing document by uploading a file
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| data | formData | Optional JSON string with document update settings. | No | string |
| file | formData | Replacement document file. | No | file |
| dataset_id | path | Dataset ID | Yes | string |
| document_id | path | Document ID | Yes | string |
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document updated successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Document not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document updated successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Document not found | |
### /datasets/{dataset_id}/documents/{document_id}/download
@@ -1274,16 +1284,18 @@ Deprecated legacy alias for updating an existing document by uploading a file. U
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| data | formData | Optional JSON string with document update settings. | No | string |
| file | formData | Replacement document file. | No | file |
| dataset_id | path | Dataset ID | Yes | string |
| document_id | path | Document ID | Yes | string |
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document updated successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Document not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document updated successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Document not found | |
### /datasets/{dataset_id}/documents/{document_id}/update-by-text
@@ -1302,11 +1314,11 @@ Update an existing document by providing text content
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document updated successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Document not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document updated successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Document not found | |
### /datasets/{dataset_id}/documents/{document_id}/update_by_file
@@ -1320,16 +1332,18 @@ Deprecated legacy alias for updating an existing document by uploading a file. U
| Name | Located in | Description | Required | Schema |
| ---- | ---------- | ----------- | -------- | ------ |
| data | formData | Optional JSON string with document update settings. | No | string |
| file | formData | Replacement document file. | No | file |
| dataset_id | path | Dataset ID | Yes | string |
| document_id | path | Document ID | Yes | string |
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document updated successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Document not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document updated successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Document not found | |
### /datasets/{dataset_id}/documents/{document_id}/update_by_text
@@ -1349,11 +1363,11 @@ Deprecated legacy alias for updating an existing document by providing text cont
##### Responses
| Code | Description |
| ---- | ----------- |
| 200 | Document updated successfully |
| 401 | Unauthorized - invalid API token |
| 404 | Document not found |
| Code | Description | Schema |
| ---- | ----------- | ------ |
| 200 | Document updated successfully | [DocumentAndBatchResponse](#documentandbatchresponse) |
| 401 | Unauthorized - invalid API token | |
| 404 | Document not found | |
### /datasets/{dataset_id}/hit-testing
@@ -2288,7 +2302,7 @@ Condition detail
| ---- | ---- | ----------- | -------- |
| comparison_operator | string | *Enum:* `"<"`, `"="`, `">"`, `"after"`, `"before"`, `"contains"`, `"empty"`, `"end with"`, `"in"`, `"is"`, `"is not"`, `"not contains"`, `"not empty"`, `"not in"`, `"start with"`, `"≠"`, `"≤"`, `"≥"` | Yes |
| name | string | | Yes |
| value | | | No |
| value | string<br>[ string ]<br>integer<br>number | | No |
#### ConversationListQuery
@@ -2637,6 +2651,13 @@ Condition detail
| inputs | object | | Yes |
| is_published | boolean | | Yes |
#### DocumentAndBatchResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| batch | string | | Yes |
| document | [DocumentResponse](#documentresponse) | | Yes |
#### DocumentBatchDownloadZipPayload
Request payload for bulk downloading documents as a zip archive.
@@ -2654,6 +2675,16 @@ Request payload for bulk downloading documents as a zip archive.
| page | integer | Page number | No |
| status | string | Document status filter | No |
#### DocumentListResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| data | [ [DocumentResponse](#documentresponse) ] | | Yes |
| has_more | boolean | | Yes |
| limit | integer | | Yes |
| page | integer | | Yes |
| total | integer | | Yes |
#### DocumentMetadataOperation
| Name | Type | Description | Required |
@@ -2662,6 +2693,67 @@ Request payload for bulk downloading documents as a zip archive.
| metadata_list | [ [MetadataDetail](#metadatadetail) ] | | Yes |
| partial_update | boolean | | No |
#### DocumentMetadataResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| id | string | | Yes |
| name | string | | Yes |
| type | string | | Yes |
| value | string<br>integer<br>number<br>boolean | | No |
#### DocumentResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| archived | boolean | | No |
| created_at | integer | | No |
| created_by | string | | No |
| created_from | string | | No |
| data_source_detail_dict | | | No |
| data_source_info | | | No |
| data_source_type | string | | No |
| dataset_process_rule_id | string | | No |
| disabled_at | integer | | No |
| disabled_by | string | | No |
| display_status | string | | No |
| doc_form | string | | No |
| doc_metadata | [ [DocumentMetadataResponse](#documentmetadataresponse) ] | | No |
| enabled | boolean | | No |
| error | string | | No |
| hit_count | integer | | No |
| id | string | | Yes |
| indexing_status | string | | No |
| name | string | | Yes |
| need_summary | boolean | | No |
| position | integer | | No |
| summary_index_status | string | | No |
| tokens | integer | | No |
| word_count | integer | | No |
#### DocumentStatusListResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| data | [ [DocumentStatusResponse](#documentstatusresponse) ] | | Yes |
#### DocumentStatusResponse
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| cleaning_completed_at | integer | | Yes |
| completed_at | integer | | Yes |
| completed_segments | integer | | No |
| error | string | | Yes |
| id | string | | Yes |
| indexing_status | string | | Yes |
| parsing_completed_at | integer | | Yes |
| paused_at | integer | | Yes |
| processing_started_at | integer | | Yes |
| splitting_completed_at | integer | | Yes |
| stopped_at | integer | | Yes |
| total_segments | integer | | No |
#### DocumentTextCreatePayload
| Name | Type | Description | Required |
@@ -2896,7 +2988,7 @@ Note: The SQLAlchemy model defines an `is_anonymous` property for Flask-Login se
| ---- | ---- | ----------- | -------- |
| id | string | | Yes |
| name | string | | Yes |
| value | | | No |
| value | string<br>integer<br>number | | No |
#### MetadataFilteringCondition
@@ -3247,7 +3339,7 @@ Accept the legacy single-tag Service API payload while exposing a normalized tag
| created_by_end_user | [SimpleEndUser](#simpleenduser) | | No |
| created_by_role | string | | No |
| created_from | string | | No |
| details | | | No |
| details | object<br>[ object ]<br>string<br>integer<br>number<br>boolean | | No |
| id | string | | Yes |
| workflow_run | [WorkflowRunForLogResponse](#workflowrunforlogresponse) | | No |
@@ -3269,7 +3361,7 @@ Accept the legacy single-tag Service API payload while exposing a normalized tag
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| created_at | integer | | No |
| elapsed_time | | | No |
| elapsed_time | number<br>integer | | No |
| error | string | | No |
| exceptions_count | integer | | No |
| finished_at | integer | | No |
@@ -3293,11 +3385,11 @@ Accept the legacy single-tag Service API payload while exposing a normalized tag
| Name | Type | Description | Required |
| ---- | ---- | ----------- | -------- |
| created_at | integer | | No |
| elapsed_time | | | No |
| elapsed_time | number<br>integer | | No |
| error | string | | No |
| finished_at | integer | | No |
| id | string | | Yes |
| inputs | | | No |
| inputs | object<br>[ object ]<br>string<br>integer<br>number<br>boolean | | No |
| outputs | object | | No |
| status | string | | Yes |
| total_steps | integer | | No |