|
14 | 14 |
|
15 | 15 | # generated by datamodel-codegen: |
16 | 16 | # filename: openapi.merged.yaml |
17 | | -# timestamp: 2025-07-11T05:56:53+00:00 |
| 17 | +# timestamp: 2025-07-11T06:38:38+00:00 |
18 | 18 |
|
19 | 19 | from __future__ import annotations |
20 | 20 |
|
@@ -859,30 +859,19 @@ class TargetEntityDataRequest(BaseModel): |
859 | 859 |
|
860 | 860 | class NodeMergeRequest(BaseModel): |
861 | 861 | """ |
862 | | - Request to merge multiple graph nodes. |
863 | | -
|
864 | | - You can provide either: |
865 | | - - entity_ids: List of entity IDs to merge directly |
866 | | - - suggestion_id: ID of a suggestion to merge |
867 | | -
|
868 | | - If both are provided, suggestion_id takes precedence and entity_ids will be ignored. |
| 862 | + Request to merge multiple graph nodes directly using entity IDs. |
869 | 863 |
|
870 | 864 | """ |
871 | 865 |
|
872 | 866 | class Config: |
873 | 867 | extra = Extra.forbid |
874 | 868 |
|
875 | | - entity_ids: Optional[list[str]] = Field( |
876 | | - None, |
877 | | - description='List of entity IDs to merge (supports 1 or more entities). Ignored if suggestion_id is also provided.', |
| 869 | + entity_ids: list[str] = Field( |
| 870 | + ..., |
| 871 | + description='List of entity IDs to merge directly', |
878 | 872 | example=['墨香居', '书店', '旧书店'], |
879 | 873 | min_items=1, |
880 | 874 | ) |
881 | | - suggestion_id: Optional[str] = Field( |
882 | | - None, |
883 | | - description='Single suggestion ID to merge. If provided, takes precedence over entity_ids.', |
884 | | - example='msug123', |
885 | | - ) |
886 | 875 | target_entity_data: Optional[TargetEntityDataRequest] = None |
887 | 876 |
|
888 | 877 |
|
@@ -1058,6 +1047,52 @@ class MergeSuggestionsResponse(BaseModel): |
1058 | 1047 | ) |
1059 | 1048 |
|
1060 | 1049 |
|
| 1050 | +class SuggestionActionRequest(BaseModel): |
| 1051 | + """ |
| 1052 | + Request to take action on a merge suggestion |
| 1053 | + """ |
| 1054 | + |
| 1055 | + class Config: |
| 1056 | + extra = Extra.forbid |
| 1057 | + |
| 1058 | + action: Literal['accept', 'reject'] = Field( |
| 1059 | + ..., |
| 1060 | + description="Action to take on the suggestion (case-insensitive, e.g., 'Accept', 'REJECT', 'accept')", |
| 1061 | + example='accept', |
| 1062 | + ) |
| 1063 | + target_entity_data: Optional[TargetEntityDataRequest] = Field( |
| 1064 | + None, |
| 1065 | + description="Optional override for target entity data (only used when action is 'accept')", |
| 1066 | + ) |
| 1067 | + |
| 1068 | + |
| 1069 | +class SuggestionActionResponse(BaseModel): |
| 1070 | + """ |
| 1071 | + Response containing suggestion action results |
| 1072 | + """ |
| 1073 | + |
| 1074 | + status: Literal['success', 'error'] = Field( |
| 1075 | + ..., description='Status of the action operation', example='success' |
| 1076 | + ) |
| 1077 | + message: str = Field( |
| 1078 | + ..., |
| 1079 | + description='Detailed message about the action operation', |
| 1080 | + example='Suggestion msug123 has been accepted and merge completed', |
| 1081 | + ) |
| 1082 | + suggestion_id: str = Field( |
| 1083 | + ..., description='The suggestion ID that was processed', example='msug123' |
| 1084 | + ) |
| 1085 | + action: Literal['accept', 'reject'] = Field( |
| 1086 | + ..., |
| 1087 | + description='The action that was performed (normalized to lowercase)', |
| 1088 | + example='accept', |
| 1089 | + ) |
| 1090 | + merge_result: Optional[NodeMergeResponse] = Field( |
| 1091 | + None, |
| 1092 | + description="Merge operation result (only present when action is 'accept')", |
| 1093 | + ) |
| 1094 | + |
| 1095 | + |
1061 | 1096 | class ApiKey(BaseModel): |
1062 | 1097 | id: Optional[str] = None |
1063 | 1098 | key: Optional[str] = None |
|
0 commit comments