synapse-sdk 2025.9.1__py3-none-any.whl → 2025.9.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of synapse-sdk might be problematic. Click here for more details.

Files changed (81) hide show
  1. synapse_sdk/devtools/docs/docs/api/clients/annotation-mixin.md +378 -0
  2. synapse_sdk/devtools/docs/docs/api/clients/backend.md +368 -1
  3. synapse_sdk/devtools/docs/docs/api/clients/core-mixin.md +477 -0
  4. synapse_sdk/devtools/docs/docs/api/clients/data-collection-mixin.md +422 -0
  5. synapse_sdk/devtools/docs/docs/api/clients/hitl-mixin.md +554 -0
  6. synapse_sdk/devtools/docs/docs/api/clients/index.md +391 -0
  7. synapse_sdk/devtools/docs/docs/api/clients/integration-mixin.md +571 -0
  8. synapse_sdk/devtools/docs/docs/api/clients/ml-mixin.md +578 -0
  9. synapse_sdk/devtools/docs/docs/plugins/developing-upload-template.md +1463 -0
  10. synapse_sdk/devtools/docs/docs/plugins/export-plugins.md +161 -34
  11. synapse_sdk/devtools/docs/docs/plugins/upload-plugins.md +1497 -213
  12. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/annotation-mixin.md +289 -0
  13. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/backend.md +378 -11
  14. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/core-mixin.md +417 -0
  15. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/data-collection-mixin.md +356 -0
  16. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/hitl-mixin.md +192 -0
  17. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/index.md +391 -0
  18. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/integration-mixin.md +479 -0
  19. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/api/clients/ml-mixin.md +284 -0
  20. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/developing-upload-template.md +1463 -0
  21. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/export-plugins.md +161 -34
  22. synapse_sdk/devtools/docs/i18n/ko/docusaurus-plugin-content-docs/current/plugins/upload-plugins.md +1752 -572
  23. synapse_sdk/devtools/docs/sidebars.ts +7 -0
  24. synapse_sdk/plugins/README.md +1 -2
  25. synapse_sdk/plugins/categories/base.py +7 -0
  26. synapse_sdk/plugins/categories/export/actions/__init__.py +3 -0
  27. synapse_sdk/plugins/categories/export/actions/export/__init__.py +28 -0
  28. synapse_sdk/plugins/categories/export/actions/export/action.py +160 -0
  29. synapse_sdk/plugins/categories/export/actions/export/enums.py +113 -0
  30. synapse_sdk/plugins/categories/export/actions/export/exceptions.py +53 -0
  31. synapse_sdk/plugins/categories/export/actions/export/models.py +74 -0
  32. synapse_sdk/plugins/categories/export/actions/export/run.py +195 -0
  33. synapse_sdk/plugins/categories/export/actions/export/utils.py +187 -0
  34. synapse_sdk/plugins/categories/export/templates/plugin/__init__.py +1 -1
  35. synapse_sdk/plugins/categories/upload/actions/upload/__init__.py +1 -2
  36. synapse_sdk/plugins/categories/upload/actions/upload/action.py +154 -531
  37. synapse_sdk/plugins/categories/upload/actions/upload/context.py +185 -0
  38. synapse_sdk/plugins/categories/upload/actions/upload/factory.py +143 -0
  39. synapse_sdk/plugins/categories/upload/actions/upload/models.py +66 -29
  40. synapse_sdk/plugins/categories/upload/actions/upload/orchestrator.py +182 -0
  41. synapse_sdk/plugins/categories/upload/actions/upload/registry.py +113 -0
  42. synapse_sdk/plugins/categories/upload/actions/upload/steps/__init__.py +1 -0
  43. synapse_sdk/plugins/categories/upload/actions/upload/steps/base.py +106 -0
  44. synapse_sdk/plugins/categories/upload/actions/upload/steps/cleanup.py +62 -0
  45. synapse_sdk/plugins/categories/upload/actions/upload/steps/collection.py +62 -0
  46. synapse_sdk/plugins/categories/upload/actions/upload/steps/generate.py +80 -0
  47. synapse_sdk/plugins/categories/upload/actions/upload/steps/initialize.py +66 -0
  48. synapse_sdk/plugins/categories/upload/actions/upload/steps/metadata.py +101 -0
  49. synapse_sdk/plugins/categories/upload/actions/upload/steps/organize.py +89 -0
  50. synapse_sdk/plugins/categories/upload/actions/upload/steps/upload.py +96 -0
  51. synapse_sdk/plugins/categories/upload/actions/upload/steps/validate.py +61 -0
  52. synapse_sdk/plugins/categories/upload/actions/upload/strategies/__init__.py +1 -0
  53. synapse_sdk/plugins/categories/upload/actions/upload/strategies/base.py +86 -0
  54. synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/__init__.py +1 -0
  55. synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/batch.py +39 -0
  56. synapse_sdk/plugins/categories/upload/actions/upload/strategies/data_unit/single.py +34 -0
  57. synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/__init__.py +1 -0
  58. synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/flat.py +233 -0
  59. synapse_sdk/plugins/categories/upload/actions/upload/strategies/file_discovery/recursive.py +253 -0
  60. synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/__init__.py +1 -0
  61. synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/excel.py +174 -0
  62. synapse_sdk/plugins/categories/upload/actions/upload/strategies/metadata/none.py +16 -0
  63. synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/__init__.py +1 -0
  64. synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/async_upload.py +109 -0
  65. synapse_sdk/plugins/categories/upload/actions/upload/strategies/upload/sync.py +43 -0
  66. synapse_sdk/plugins/categories/upload/actions/upload/strategies/validation/__init__.py +1 -0
  67. synapse_sdk/plugins/categories/upload/actions/upload/strategies/validation/default.py +45 -0
  68. synapse_sdk/plugins/categories/upload/actions/upload/utils.py +194 -83
  69. synapse_sdk/plugins/categories/upload/templates/config.yaml +4 -0
  70. synapse_sdk/plugins/categories/upload/templates/plugin/__init__.py +269 -0
  71. synapse_sdk/plugins/categories/upload/templates/plugin/upload.py +71 -27
  72. synapse_sdk/plugins/models.py +7 -0
  73. synapse_sdk/shared/__init__.py +21 -0
  74. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/METADATA +2 -1
  75. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/RECORD +79 -28
  76. synapse_sdk/plugins/categories/export/actions/export.py +0 -385
  77. synapse_sdk/plugins/categories/export/enums.py +0 -7
  78. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/WHEEL +0 -0
  79. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/entry_points.txt +0 -0
  80. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/licenses/LICENSE +0 -0
  81. {synapse_sdk-2025.9.1.dist-info → synapse_sdk-2025.9.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,289 @@
1
+ ---
2
+ id: annotation-mixin
3
+ title: AnnotationClientMixin
4
+ sidebar_position: 11
5
+ ---
6
+
7
+ # AnnotationClientMixin
8
+
9
+ Synapse 백엔드를 위한 어노테이션 및 태스크 관리 작업을 제공합니다.
10
+
11
+ ## 개요
12
+
13
+ `AnnotationClientMixin`은 태스크, 어노테이션, 프로젝트, 태스크 태깅과 관련된 모든 작업을 처리합니다. 이 믹스인은 `BackendClient`에 자동으로 포함되며 어노테이션 워크플로를 위한 메서드를 제공합니다.
14
+
15
+ ## 프로젝트 작업
16
+
17
+ ### `get_project(pk)`
18
+
19
+ 특정 프로젝트에 대한 상세 정보를 가져옵니다.
20
+
21
+ ```python
22
+ project = client.get_project(123)
23
+ print(f"프로젝트: {project['name']}")
24
+ print(f"설명: {project['description']}")
25
+ ```
26
+
27
+ **매개변수:**
28
+
29
+ - `pk` (int): 프로젝트 ID
30
+
31
+ **반환값:**
32
+
33
+ - `dict`: 구성, 메타데이터, 설정을 포함한 프로젝트 상세정보
34
+
35
+ ## 태스크 작업
36
+
37
+ ### `get_task(pk, params)`
38
+
39
+ 특정 태스크에 대한 상세 정보를 가져옵니다.
40
+
41
+ ```python
42
+ # 기본 태스크 상세정보
43
+ task = client.get_task(456)
44
+
45
+ # 확장된 데이터 유닛이 포함된 태스크
46
+ task = client.get_task(456, params={'expand': 'data_unit'})
47
+
48
+ # 여러 확장이 포함된 태스크
49
+ task = client.get_task(456, params={
50
+ 'expand': ['data_unit', 'assignment', 'annotations']
51
+ })
52
+ ```
53
+
54
+ **매개변수:**
55
+
56
+ - `pk` (int): 태스크 ID
57
+ - `params` (dict): 필터링 및 확장을 위한 쿼리 매개변수
58
+
59
+ **일반적인 params:**
60
+
61
+ - `expand`: 포함할 관련 객체의 목록 또는 문자열
62
+ - `include_annotations`: 어노테이션 데이터 포함 여부
63
+
64
+ ### `annotate_task_data(pk, data)`
65
+
66
+ 태스크에 대한 어노테이션 데이터를 제출합니다.
67
+
68
+ ```python
69
+ # 바운딩 박스 어노테이션 제출
70
+ annotation_data = {
71
+ 'annotations': [
72
+ {
73
+ 'type': 'bbox',
74
+ 'coordinates': [10, 10, 100, 100],
75
+ 'label': 'person',
76
+ 'confidence': 0.95
77
+ },
78
+ {
79
+ 'type': 'polygon',
80
+ 'points': [[0, 0], [50, 0], [50, 50], [0, 50]],
81
+ 'label': 'vehicle'
82
+ }
83
+ ],
84
+ 'metadata': {
85
+ 'annotator_id': 'user123',
86
+ 'timestamp': '2023-10-01T12:00:00Z'
87
+ }
88
+ }
89
+
90
+ result = client.annotate_task_data(456, annotation_data)
91
+ ```
92
+
93
+ **매개변수:**
94
+
95
+ - `pk` (int): 태스크 ID
96
+ - `data` (dict): 어노테이션 데이터 구조
97
+
98
+ **반환값:**
99
+
100
+ - `dict`: 제출된 어노테이션이 포함된 업데이트된 태스크
101
+
102
+ ### `list_tasks(params=None, url_conversion=None, list_all=False)`
103
+
104
+ 필터링 및 페이지네이션 지원과 함께 태스크를 나열합니다.
105
+
106
+ ```python
107
+ # 특정 프로젝트의 태스크 나열
108
+ tasks = client.list_tasks(params={'project': 123})
109
+
110
+ # 상태 필터가 적용된 태스크 나열
111
+ tasks = client.list_tasks(params={
112
+ 'project': 123,
113
+ 'status': 'pending'
114
+ })
115
+
116
+ # 모든 태스크 가져오기 (페이지네이션 자동 처리)
117
+ all_tasks = client.list_tasks(list_all=True)
118
+
119
+ # 파일에 대한 사용자 정의 URL 변환과 함께 태스크 나열
120
+ tasks = client.list_tasks(
121
+ params={'project': 123},
122
+ url_conversion={'files': lambda url: f"https://cdn.example.com{url}"}
123
+ )
124
+ ```
125
+
126
+ **매개변수:**
127
+
128
+ - `params` (dict, 선택사항): 필터링 매개변수
129
+ - `url_conversion` (dict, 선택사항): 파일 필드에 대한 사용자 정의 URL 변환
130
+ - `list_all` (bool): True인 경우, 모든 결과를 가져오기 위해 페이지네이션을 자동 처리
131
+
132
+ **일반적인 필터링 params:**
133
+
134
+ - `project`: 프로젝트 ID로 필터링
135
+ - `status`: 태스크 상태로 필터링 (`pending`, `in_progress`, `completed`)
136
+ - `assignee`: 할당된 사용자 ID로 필터링
137
+ - `created_after`: 생성 날짜로 필터링
138
+ - `search`: 태스크 내용에서 텍스트 검색
139
+
140
+ **반환값:**
141
+
142
+ - `tuple`: `list_all=False`인 경우 (tasks_list, total_count)
143
+ - `list`: `list_all=True`인 경우 모든 태스크
144
+
145
+ ### `create_tasks(data)`
146
+
147
+ 하나 이상의 새 태스크를 생성합니다.
148
+
149
+ ```python
150
+ # 단일 태스크 생성
151
+ new_task = client.create_tasks({
152
+ 'project': 123,
153
+ 'data_unit': 789,
154
+ 'priority': 'high',
155
+ 'metadata': {'batch': 'batch_001'}
156
+ })
157
+
158
+ # 여러 태스크 생성
159
+ new_tasks = client.create_tasks([
160
+ {'project': 123, 'data_unit': 789},
161
+ {'project': 123, 'data_unit': 790},
162
+ {'project': 123, 'data_unit': 791}
163
+ ])
164
+ ```
165
+
166
+ **매개변수:**
167
+
168
+ - `data` (dict 또는 list): 태스크 데이터 또는 태스크 데이터 목록
169
+
170
+ **태스크 데이터 구조:**
171
+
172
+ - `project` (int, 필수): 프로젝트 ID
173
+ - `data_unit` (int, 필수): 데이터 유닛 ID
174
+ - `priority` (str, 선택사항): 태스크 우선순위 (`low`, `normal`, `high`)
175
+ - `assignee` (int, 선택사항): 태스크를 할당할 사용자 ID
176
+ - `metadata` (dict, 선택사항): 추가 태스크 메타데이터
177
+
178
+ **반환값:**
179
+
180
+ - `dict` 또는 `list`: 생성된 ID가 포함된 생성된 태스크
181
+
182
+ ### `set_tags_tasks(data, params=None)`
183
+
184
+ 여러 태스크에 일괄적으로 태그를 설정합니다.
185
+
186
+ ```python
187
+ # 여러 태스크에 태그 설정
188
+ client.set_tags_tasks({
189
+ 'task_ids': [456, 457, 458],
190
+ 'tag_ids': [1, 2, 3] # 적용할 태그 ID
191
+ })
192
+
193
+ # 추가 매개변수와 함께 태그 설정
194
+ client.set_tags_tasks(
195
+ {
196
+ 'task_ids': [456, 457],
197
+ 'tag_ids': [1, 2]
198
+ },
199
+ params={'replace': True} # 기존 태그 교체
200
+ )
201
+ ```
202
+
203
+ **매개변수:**
204
+
205
+ - `data` (dict): 일괄 태깅 데이터
206
+ - `params` (dict, 선택사항): 추가 매개변수
207
+
208
+ **데이터 구조:**
209
+
210
+ - `task_ids` (list): 태그를 설정할 태스크 ID 목록
211
+ - `tag_ids` (list): 적용할 태그 ID 목록
212
+
213
+ **선택적 params:**
214
+
215
+ - `replace` (bool): True인 경우 기존 태그 교체, False인 경우 기존 태그에 추가
216
+
217
+ ## 태스크 태그 작업
218
+
219
+ ### `get_task_tag(pk)`
220
+
221
+ 특정 태스크 태그에 대한 상세정보를 가져옵니다.
222
+
223
+ ```python
224
+ tag = client.get_task_tag(123)
225
+ print(f"태그: {tag['name']} - {tag['description']}")
226
+ ```
227
+
228
+ **매개변수:**
229
+
230
+ - `pk` (int): 태그 ID
231
+
232
+ **반환값:**
233
+
234
+ - `dict`: 이름, 설명, 메타를 포함한 태그 상세정보
235
+
236
+ ### `list_task_tags(params)`
237
+
238
+ 필터링과 함께 사용 가능한 태스크 태그를 나열합니다.
239
+
240
+ ```python
241
+ # 모든 태그 나열
242
+ tags = client.list_task_tags({})
243
+
244
+ # 특정 프로젝트의 태그 나열
245
+ project_tags = client.list_task_tags({
246
+ 'project': 123
247
+ })
248
+
249
+ # 이름으로 태그 검색
250
+ search_tags = client.list_task_tags({
251
+ 'search': 'quality'
252
+ })
253
+ ```
254
+
255
+ **매개변수:**
256
+
257
+ - `params` (dict): 필터링 매개변수
258
+
259
+ **일반적인 필터링 params:**
260
+
261
+ - `project`: 프로젝트 ID로 필터링
262
+ - `search`: 태그 이름에서 텍스트 검색
263
+ - `color`: 태그 색상으로 필터링
264
+
265
+ **반환값:**
266
+
267
+ - `tuple`: (tags_list, total_count)
268
+
269
+ ## 오류 처리
270
+
271
+ ```python
272
+ from synapse_sdk.clients.exceptions import ClientError
273
+
274
+ try:
275
+ task = client.get_task(999999)
276
+ except ClientError as e:
277
+ if e.status_code == 404:
278
+ print("태스크를 찾을 수 없음")
279
+ elif e.status_code == 403:
280
+ print("권한이 거부됨")
281
+ else:
282
+ print(f"API 오류: {e}")
283
+ ```
284
+
285
+ ## 참고
286
+
287
+ - [BackendClient](./backend.md) - 메인 백엔드 클라이언트
288
+ - [HITLClientMixin](./hitl-mixin.md) - Human-in-the-loop 작업
289
+ - [DataCollectionClientMixin](./data-collection-mixin.md) - 데이터 관리
@@ -1,18 +1,25 @@
1
1
  ---
2
2
  id: backend
3
3
  title: BackendClient
4
- sidebar_position: 1
4
+ sidebar_position: 10
5
5
  ---
6
6
 
7
7
  # BackendClient
8
8
 
9
- Synapse backend API와 상호작용하기 위한 메인 클라이언트입니다.
9
+ Synapse 백엔드 API와 상호작용하기 위한 메인 클라이언트입니다.
10
10
 
11
11
  ## 개요
12
12
 
13
- `BackendClient`는 데이터 관리, 플러그인 실행, 어노테이션, 머신러닝 워크플로우를 포함한 모든 backend 작업에 대한 포괄적인 액세스를 제공합니다. 여러 전문화된 mixin의 기능을 집계합니다.
13
+ `BackendClient`는 데이터 관리, 플러그인 실행, 어노테이션, 머신러닝 워크플로를 포함한 모든 백엔드 작업에 대한 포괄적인 액세스를 제공합니다. 여러 전문화된 믹스인의 기능을 통합합니다:
14
14
 
15
- ## Constructor
15
+ - **AnnotationClientMixin**: 작업 및 어노테이션 관리
16
+ - **CoreClientMixin**: 파일 업로드 및 핵심 작업
17
+ - **DataCollectionClientMixin**: 데이터 수집 및 파일 관리
18
+ - **HITLClientMixin**: Human-in-the-loop 할당 작업
19
+ - **IntegrationClientMixin**: 플러그인 및 작업 관리
20
+ - **MLClientMixin**: 머신러닝 모델 및 정답 데이터 작업
21
+
22
+ ## 생성자
16
23
 
17
24
  ```python
18
25
  BackendClient(
@@ -23,19 +30,19 @@ BackendClient(
23
30
  )
24
31
  ```
25
32
 
26
- ### Parameters
33
+ ### 매개변수
27
34
 
28
- - **base_url** (`str`): Synapse backend API의 기본 URL
35
+ - **base_url** (`str`): Synapse 백엔드 API의 기본 URL
29
36
  - **api_token** (`str`, 선택사항): API 인증 토큰. `SYNAPSE_API_TOKEN` 환경변수로도 설정 가능
30
- - **agent_token** (`str`, 선택사항): Agent 인증 토큰. `SYNAPSE_AGENT_TOKEN` 환경변수로도 설정 가능
31
- - **timeout** (`dict`, 선택사항): 사용자 정의 timeout 설정. 기본값은 `{'connect': 5, 'read': 30}`
37
+ - **agent_token** (`str`, 선택사항): 에이전트 인증 토큰. `SYNAPSE_AGENT_TOKEN` 환경변수로도 설정 가능
38
+ - **timeout** (`dict`, 선택사항): 사용자 정의 타임아웃 설정. 기본값은 `{'connect': 5, 'read': 30}`
32
39
 
33
40
  ### 예제
34
41
 
35
42
  ```python
36
43
  from synapse_sdk.clients.backend import BackendClient
37
44
 
38
- # 명시적 토큰으로 클라이언트 생성
45
+ # 토큰을 명시적으로 지정하여 클라이언트 생성
39
46
  client = BackendClient(
40
47
  base_url="https://api.synapse.sh",
41
48
  api_token="your-api-token"
@@ -47,7 +54,367 @@ os.environ['SYNAPSE_API_TOKEN'] = "your-api-token"
47
54
  client = BackendClient(base_url="https://api.synapse.sh")
48
55
  ```
49
56
 
57
+ ## API 메서드
58
+
59
+ ### 어노테이션 작업
60
+
61
+ #### `get_project(pk)`
62
+
63
+ ID로 프로젝트 상세정보를 가져옵니다.
64
+
65
+ ```python
66
+ project = client.get_project(123)
67
+ ```
68
+
69
+ #### `get_task(pk, params)`
70
+
71
+ 선택적 매개변수와 함께 작업 상세정보를 가져옵니다.
72
+
73
+ ```python
74
+ task = client.get_task(456, params={'expand': 'data_unit'})
75
+ ```
76
+
77
+ #### `annotate_task_data(pk, data)`
78
+
79
+ 작업에 대한 어노테이션 데이터를 제출합니다.
80
+
81
+ ```python
82
+ result = client.annotate_task_data(456, {
83
+ 'annotations': [
84
+ {'type': 'bbox', 'coordinates': [10, 10, 100, 100]}
85
+ ]
86
+ })
87
+ ```
88
+
89
+ #### `list_tasks(params=None, url_conversion=None, list_all=False)`
90
+
91
+ 필터링 및 페이지네이션과 함께 작업 목록을 가져옵니다.
92
+
93
+ ```python
94
+ # 프로젝트의 작업 가져오기
95
+ tasks = client.list_tasks(params={'project': 123})
96
+
97
+ # 모든 작업 가져오기 (페이지네이션 자동 처리)
98
+ all_tasks = client.list_tasks(list_all=True)
99
+ ```
100
+
101
+ #### `create_tasks(data)`
102
+
103
+ 새로운 작업를 생성합니다.
104
+
105
+ ```python
106
+ new_tasks = client.create_tasks([
107
+ {'project': 123, 'data_unit': 789},
108
+ {'project': 123, 'data_unit': 790}
109
+ ])
110
+ ```
111
+
112
+ #### `set_tags_tasks(data, params=None)`
113
+
114
+ 여러 작업에 태그를 설정합니다.
115
+
116
+ ```python
117
+ client.set_tags_tasks({
118
+ 'task_ids': [456, 457],
119
+ 'tag_ids': [1, 2, 3]
120
+ })
121
+ ```
122
+
123
+ ### 핵심 작업
124
+
125
+ #### `create_chunked_upload(file_path)`
126
+
127
+ 최적 성능을 위해 청크 업로드를 사용하여 대용량 파일을 업로드합니다.
128
+
129
+ ```python
130
+ from pathlib import Path
131
+
132
+ result = client.create_chunked_upload(Path('/path/to/large_file.zip'))
133
+ print(f"업로드 완료: {result}")
134
+ ```
135
+
136
+ **기능:**
137
+
138
+ - 최적 성능을 위한 50MB 청크 사용
139
+ - 자동 재시도 및 재개 기능
140
+ - MD5 무결성 검증
141
+ - 진행률 추적 지원
142
+
143
+ ### 데이터 수집 작업
144
+
145
+ #### `list_data_collection()`
146
+
147
+ 사용 가능한 모든 데이터 컬렉션을 나열합니다.
148
+
149
+ ```python
150
+ collections = client.list_data_collection()
151
+ ```
152
+
153
+ #### `get_data_collection(data_collection_id)`
154
+
155
+ 특정 데이터 컬렉션에 대한 상세 정보를 가져옵니다.
156
+
157
+ ```python
158
+ collection = client.get_data_collection(123)
159
+ file_specs = collection['file_specifications']
160
+ ```
161
+
162
+ #### `create_data_file(file_path, use_chunked_upload=False)`
163
+
164
+ 백엔드에 데이터 파일을 생성하고 업로드합니다.
165
+
166
+ ```python
167
+ from pathlib import Path
168
+
169
+ # 일반 업로드
170
+ data_file = client.create_data_file(Path('/path/to/file.jpg'))
171
+
172
+ # 대용량 파일을 위한 청크 업로드
173
+ large_file = client.create_data_file(
174
+ Path('/path/to/large_file.zip'),
175
+ use_chunked_upload=True
176
+ )
177
+ ```
178
+
179
+ #### `upload_data_file(organized_file, collection_id, use_chunked_upload=False)`
180
+
181
+ 정리된 파일 데이터를 컬렉션에 업로드합니다.
182
+
183
+ ```python
184
+ result = client.upload_data_file(
185
+ organized_file={'files': {...}, 'meta': {...}},
186
+ collection_id=123,
187
+ use_chunked_upload=False
188
+ )
189
+ ```
190
+
191
+ #### `create_data_units(uploaded_files)`
192
+
193
+ 업로드된 파일에서 데이터 유닛을 생성합니다.
194
+
195
+ ```python
196
+ data_units = client.create_data_units([
197
+ {'id': 1, 'file': {...}},
198
+ {'id': 2, 'file': {...}}
199
+ ])
200
+ ```
201
+
202
+ ### HITL (Human-in-the-Loop) 작업
203
+
204
+ #### `get_assignment(pk)`
205
+
206
+ ID로 할당 상세정보를 가져옵니다.
207
+
208
+ ```python
209
+ assignment = client.get_assignment(789)
210
+ ```
211
+
212
+ #### `list_assignments(params=None, url_conversion=None, list_all=False)`
213
+
214
+ 필터링 옵션과 함께 할당 목록을 가져옵니다.
215
+
216
+ ```python
217
+ # 프로젝트의 할당 가져오기
218
+ assignments = client.list_assignments(params={'project': 123})
219
+
220
+ # 모든 할당 가져오기
221
+ all_assignments = client.list_assignments(list_all=True)
222
+ ```
223
+
224
+ #### `set_tags_assignments(data, params=None)`
225
+
226
+ 여러 할당에 태그를 설정합니다.
227
+
228
+ ```python
229
+ client.set_tags_assignments({
230
+ 'assignment_ids': [789, 790],
231
+ 'tag_ids': [1, 2]
232
+ })
233
+ ```
234
+
235
+ ### 통합 작업
236
+
237
+ #### `health_check_agent(token)`
238
+
239
+ 에이전트 상태를 확인합니다.
240
+
241
+ ```python
242
+ status = client.health_check_agent('agent-token-123')
243
+ ```
244
+
245
+ #### `get_plugin(pk)` / `create_plugin(data)` / `update_plugin(pk, data)`
246
+
247
+ 플러그인을 관리합니다.
248
+
249
+ ```python
250
+ # 플러그인 가져오기
251
+ plugin = client.get_plugin(123)
252
+
253
+ # 플러그인 생성
254
+ new_plugin = client.create_plugin({
255
+ 'name': 'My Plugin',
256
+ 'description': 'Plugin description'
257
+ })
258
+
259
+ # 플러그인 업데이트
260
+ updated = client.update_plugin(123, {'description': 'Updated description'})
261
+ ```
262
+
263
+ #### `run_plugin(pk, data)`
264
+
265
+ 제공된 데이터로 플러그인을 실행합니다.
266
+
267
+ ```python
268
+ result = client.run_plugin(123, {
269
+ 'parameters': {'input': 'value'},
270
+ 'context': {...}
271
+ })
272
+ ```
273
+
274
+ #### 플러그인 릴리스 관리
275
+
276
+ ```python
277
+ # 플러그인 릴리스 생성
278
+ release = client.create_plugin_release({
279
+ 'plugin': 123,
280
+ 'version': '1.0.0',
281
+ 'file': open('/path/to/plugin.zip', 'rb')
282
+ })
283
+
284
+ # 릴리스 상세정보 가져오기
285
+ release_info = client.get_plugin_release(456)
286
+ ```
287
+
288
+ #### 작업 관리
289
+
290
+ ```python
291
+ # 작업 목록
292
+ jobs = client.list_jobs(params={'status': 'running'})
293
+
294
+ # 작업 상세정보 가져오기
295
+ job = client.get_job(789, params={'expand': 'logs'})
296
+
297
+ # 작업 상태 업데이트
298
+ client.update_job(789, {'status': 'completed'})
299
+
300
+ # 작업 콘솔 로그 가져오기
301
+ logs = client.list_job_console_logs(789)
302
+ ```
303
+
304
+ #### 스토리지 작업
305
+
306
+ ```python
307
+ # 스토리지 목록
308
+ storages = client.list_storages()
309
+
310
+ # 스토리지 상세정보 가져오기
311
+ storage = client.get_storage(123)
312
+
313
+ # 스토리지 생성
314
+ new_storage = client.create_storage({
315
+ 'name': 'My Storage',
316
+ 'provider': 'amazon_s3',
317
+ 'configuration': {...}
318
+ })
319
+ ```
320
+
321
+ ### 머신러닝 작업
322
+
323
+ #### `list_models(params=None)` / `get_model(pk, params=None, url_conversion=None)`
324
+
325
+ ML 모델을 관리합니다.
326
+
327
+ ```python
328
+ # 모델 목록
329
+ models = client.list_models(params={'project': 123})
330
+
331
+ # 모델 상세정보 가져오기
332
+ model = client.get_model(456, params={'expand': 'metrics'})
333
+ ```
334
+
335
+ #### `create_model(data)`
336
+
337
+ 파일 업로드와 함께 새로운 ML 모델을 생성합니다.
338
+
339
+ ```python
340
+ new_model = client.create_model({
341
+ 'name': 'My Model',
342
+ 'project': 123,
343
+ 'file': '/path/to/model.pkl'
344
+ })
345
+ ```
346
+
347
+ #### 정답 데이터 작업
348
+
349
+ ```python
350
+ # 정답 이벤트 목록
351
+ events = client.list_ground_truth_events(
352
+ params={'ground_truth_dataset_versions': [123]},
353
+ list_all=True
354
+ )
355
+
356
+ # 정답 버전 가져오기
357
+ version = client.get_ground_truth_version(123)
358
+ ```
359
+
360
+ ## 스토리지 모델
361
+
362
+ 백엔드 클라이언트는 스토리지 작업을 위한 사전 정의된 모델을 포함합니다:
363
+
364
+ ### StorageCategory
365
+
366
+ - `INTERNAL`: 내부 스토리지 시스템
367
+ - `EXTERNAL`: 외부 스토리지 제공업체
368
+
369
+ ### StorageProvider
370
+
371
+ - `AMAZON_S3`: Amazon S3
372
+ - `AZURE`: Microsoft Azure Blob Storage
373
+ - `DIGITAL_OCEAN`: DigitalOcean Spaces
374
+ - `FILE_SYSTEM`: 로컬 파일 시스템
375
+ - `FTP` / `SFTP`: FTP 프로토콜
376
+ - `MINIO`: MinIO 스토리지
377
+ - `GCP`: Google Cloud Storage
378
+
379
+ ## 오류 처리
380
+
381
+ 모든 API 메서드는 다양한 오류 조건에 대해 `ClientError` 예외를 발생시킬 수 있습니다:
382
+
383
+ ```python
384
+ from synapse_sdk.clients.exceptions import ClientError
385
+
386
+ try:
387
+ project = client.get_project(999)
388
+ except ClientError as e:
389
+ print(f"API 오류: {e}")
390
+ print(f"상태 코드: {e.status_code}")
391
+ print(f"응답: {e.response}")
392
+ ```
393
+
394
+ ## 페이지네이션
395
+
396
+ `list_all=True`를 지원하는 메서드는 자동으로 페이지네이션을 처리합니다:
397
+
398
+ ```python
399
+ # 수동 페이지네이션
400
+ tasks_page1 = client.list_tasks(params={'page': 1, 'page_size': 100})
401
+
402
+ # 자동 페이지네이션 (권장)
403
+ all_tasks = client.list_tasks(list_all=True)
404
+ ```
405
+
406
+ ## URL 변환
407
+
408
+ 일부 메서드는 파일 필드에 대한 URL 변환을 지원합니다:
409
+
410
+ ```python
411
+ # 사용자 정의 URL 변환
412
+ tasks = client.list_tasks(
413
+ url_conversion={'files': lambda url: f"https://cdn.example.com{url}"}
414
+ )
415
+ ```
416
+
50
417
  ## 참고
51
418
 
52
- - [AgentClient](./agent.md) - Agent 전용 작업을 위한 클라이언트
53
- - [BaseClient](./base.md) - 기본 클라이언트 구현
419
+ - [AgentClient](./agent.md) - 에이전트별 작업용
420
+ - [BaseClient](./base.md) - 기본 클라이언트 구현