erdo 0.1.4__py3-none-any.whl → 0.1.6__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 erdo might be problematic. Click here for more details.
- erdo/__init__.py +13 -13
- erdo/_generated/actions/__init__.py +3 -1
- erdo/_generated/actions/analysis.py +116 -4
- erdo/_generated/actions/bot.py +61 -5
- erdo/_generated/actions/codeexec.py +53 -28
- erdo/_generated/actions/llm.py +44 -5
- erdo/_generated/actions/memory.py +252 -57
- erdo/_generated/actions/pdfextractor.py +97 -0
- erdo/_generated/actions/resource_definitions.py +114 -12
- erdo/_generated/actions/sqlexec.py +86 -0
- erdo/_generated/actions/utils.py +178 -56
- erdo/_generated/actions/webparser.py +15 -5
- erdo/_generated/actions/websearch.py +15 -5
- erdo/_generated/condition/__init__.py +137 -127
- erdo/_generated/internal_actions.py +14 -2
- erdo/_generated/types.py +92 -48
- erdo/actions/__init__.py +8 -8
- erdo/bot_permissions.py +266 -0
- erdo/config/__init__.py +5 -0
- erdo/config/config.py +140 -0
- erdo/invoke/__init__.py +10 -0
- erdo/invoke/client.py +213 -0
- erdo/invoke/invoke.py +244 -0
- erdo/sync/__init__.py +17 -0
- erdo/sync/client.py +95 -0
- erdo/sync/extractor.py +482 -0
- erdo/sync/sync.py +327 -0
- erdo/types.py +516 -18
- {erdo-0.1.4.dist-info → erdo-0.1.6.dist-info}/METADATA +4 -1
- erdo-0.1.6.dist-info/RECORD +45 -0
- erdo-0.1.4.dist-info/RECORD +0 -33
- {erdo-0.1.4.dist-info → erdo-0.1.6.dist-info}/WHEEL +0 -0
- {erdo-0.1.4.dist-info → erdo-0.1.6.dist-info}/entry_points.txt +0 -0
- {erdo-0.1.4.dist-info → erdo-0.1.6.dist-info}/licenses/LICENSE +0 -0
erdo/_generated/actions/utils.py
CHANGED
|
@@ -6,22 +6,34 @@ Provides type-safe action definitions for utils service.
|
|
|
6
6
|
Actual execution happens in the Go backend after syncing.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from typing import Any,
|
|
9
|
+
from typing import Any, List, Optional, Union
|
|
10
10
|
|
|
11
11
|
from pydantic import BaseModel, Field
|
|
12
12
|
|
|
13
|
+
from erdo._generated.types import Resource
|
|
13
14
|
from erdo.template import TemplateString
|
|
14
|
-
from erdo.types import StepMetadata
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
class
|
|
17
|
+
class BaseActionParams(BaseModel):
|
|
18
|
+
"""Base class for all action parameter classes.
|
|
19
|
+
|
|
20
|
+
Provides common fields that all actions support:
|
|
21
|
+
- name: The action type identifier
|
|
22
|
+
- step_metadata: Optional configuration for the step created from this action
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: str
|
|
26
|
+
step_metadata: Optional[Any] = None
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class EchoParams(BaseActionParams):
|
|
18
30
|
"""Echo parameters back as output parameters"""
|
|
19
31
|
|
|
20
32
|
name: str = "utils.echo" # Action type for roundtrip compatibility
|
|
21
33
|
data: Optional[Any] = None # data parameter
|
|
22
34
|
|
|
23
35
|
|
|
24
|
-
class ParseJsonParams(
|
|
36
|
+
class ParseJsonParams(BaseActionParams):
|
|
25
37
|
"""Parse JSON string and validate required keys parameters"""
|
|
26
38
|
|
|
27
39
|
model_config = {"populate_by_name": True} # Allow both field names and aliases
|
|
@@ -33,7 +45,7 @@ class ParseJsonParams(BaseModel):
|
|
|
33
45
|
required_keys: Optional[Any] = None # required_keys parameter
|
|
34
46
|
|
|
35
47
|
|
|
36
|
-
class ConcatParams(
|
|
48
|
+
class ConcatParams(BaseActionParams):
|
|
37
49
|
"""Concatenate arrays or strings from specified keys parameters"""
|
|
38
50
|
|
|
39
51
|
name: str = "utils.concat" # Action type for roundtrip compatibility
|
|
@@ -41,7 +53,7 @@ class ConcatParams(BaseModel):
|
|
|
41
53
|
data: Optional[Any] = None # data parameter
|
|
42
54
|
|
|
43
55
|
|
|
44
|
-
class CastParams(
|
|
56
|
+
class CastParams(BaseActionParams):
|
|
45
57
|
"""Cast string values to different types (string, integer, float, bool) parameters"""
|
|
46
58
|
|
|
47
59
|
model_config = {"populate_by_name": True} # Allow both field names and aliases
|
|
@@ -53,7 +65,7 @@ class CastParams(BaseModel):
|
|
|
53
65
|
) # type parameter
|
|
54
66
|
|
|
55
67
|
|
|
56
|
-
class RaiseParams(
|
|
68
|
+
class RaiseParams(BaseActionParams):
|
|
57
69
|
"""Raise a status with message and parameters parameters"""
|
|
58
70
|
|
|
59
71
|
name: str = "utils.raise" # Action type for roundtrip compatibility
|
|
@@ -62,7 +74,7 @@ class RaiseParams(BaseModel):
|
|
|
62
74
|
parameters: Optional[Any] = None # parameters parameter
|
|
63
75
|
|
|
64
76
|
|
|
65
|
-
class CaptureExceptionParams(
|
|
77
|
+
class CaptureExceptionParams(BaseActionParams):
|
|
66
78
|
"""Capture an exception to Sentry and return an error result parameters"""
|
|
67
79
|
|
|
68
80
|
name: str = "utils.capture_exception" # Action type for roundtrip compatibility
|
|
@@ -71,7 +83,7 @@ class CaptureExceptionParams(BaseModel):
|
|
|
71
83
|
error_type: Optional[Union[str, TemplateString]] = None # error_type parameter
|
|
72
84
|
|
|
73
85
|
|
|
74
|
-
class SendStatusParams(
|
|
86
|
+
class SendStatusParams(BaseActionParams):
|
|
75
87
|
"""Send a status event to the client parameters"""
|
|
76
88
|
|
|
77
89
|
name: str = "utils.send_status" # Action type for roundtrip compatibility
|
|
@@ -80,7 +92,7 @@ class SendStatusParams(BaseModel):
|
|
|
80
92
|
details: Optional[Any] = None # details parameter
|
|
81
93
|
|
|
82
94
|
|
|
83
|
-
class WriteParams(
|
|
95
|
+
class WriteParams(BaseActionParams):
|
|
84
96
|
"""Write output message with specified content types parameters"""
|
|
85
97
|
|
|
86
98
|
name: str = "utils.write" # Action type for roundtrip compatibility
|
|
@@ -92,85 +104,146 @@ class WriteParams(BaseModel):
|
|
|
92
104
|
ui_content_type: Optional[Union[str, TemplateString]] = (
|
|
93
105
|
None # ui_content_type parameter
|
|
94
106
|
)
|
|
107
|
+
output_channels: Optional[Any] = None # output_channels parameter
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class ProcessIntegrationQueriesParams(BaseActionParams):
|
|
111
|
+
"""Process integration queries to create resource-specific search queries parameters"""
|
|
112
|
+
|
|
113
|
+
name: str = (
|
|
114
|
+
"utils.process_integration_queries" # Action type for roundtrip compatibility
|
|
115
|
+
)
|
|
116
|
+
query: Optional[Union[str, TemplateString]] = None # query parameter
|
|
117
|
+
resource: Optional[Any] = None # resource parameter
|
|
118
|
+
queries: Optional[Any] = None # queries parameter
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class PopulateResourceIdsParams(BaseActionParams):
|
|
122
|
+
"""Assigns incremental IDs to new resources based on the maximum existing resource ID parameters"""
|
|
123
|
+
|
|
124
|
+
name: str = "utils.populate_resource_ids" # Action type for roundtrip compatibility
|
|
125
|
+
all_resources: Optional[Any] = None # all_resources parameter
|
|
126
|
+
new_resources: Optional[Any] = None # new_resources parameter
|
|
95
127
|
|
|
96
128
|
|
|
97
129
|
class EchoResult(BaseModel):
|
|
98
130
|
"""Echo parameters back as output result type
|
|
99
131
|
|
|
100
|
-
|
|
132
|
+
Generic result schema for utils.echo action.
|
|
101
133
|
"""
|
|
102
134
|
|
|
103
|
-
|
|
135
|
+
success: bool = True # Whether the action was successful
|
|
136
|
+
|
|
137
|
+
class Config:
|
|
138
|
+
extra = "allow" # Allow additional fields dynamically
|
|
104
139
|
|
|
105
140
|
|
|
106
141
|
class ParseJsonResult(BaseModel):
|
|
107
142
|
"""Parse JSON string and validate required keys result type
|
|
108
143
|
|
|
109
|
-
|
|
144
|
+
Generic result schema for utils.parse_json action.
|
|
110
145
|
"""
|
|
111
146
|
|
|
112
|
-
|
|
147
|
+
success: bool = True # Whether the action was successful
|
|
148
|
+
|
|
149
|
+
class Config:
|
|
150
|
+
extra = "allow" # Allow additional fields dynamically
|
|
113
151
|
|
|
114
152
|
|
|
115
153
|
class ConcatResult(BaseModel):
|
|
116
154
|
"""Concatenate arrays or strings from specified keys result type
|
|
117
155
|
|
|
118
|
-
|
|
156
|
+
Generic result schema for utils.concat action.
|
|
119
157
|
"""
|
|
120
158
|
|
|
121
|
-
|
|
159
|
+
success: bool = True # Whether the action was successful
|
|
160
|
+
|
|
161
|
+
class Config:
|
|
162
|
+
extra = "allow" # Allow additional fields dynamically
|
|
122
163
|
|
|
123
164
|
|
|
124
165
|
class CastResult(BaseModel):
|
|
125
166
|
"""Cast string values to different types (string, integer, float, bool) result type
|
|
126
167
|
|
|
127
|
-
|
|
168
|
+
Generic result schema for utils.cast action.
|
|
128
169
|
"""
|
|
129
170
|
|
|
130
|
-
|
|
171
|
+
success: bool = True # Whether the action was successful
|
|
172
|
+
|
|
173
|
+
class Config:
|
|
174
|
+
extra = "allow" # Allow additional fields dynamically
|
|
131
175
|
|
|
132
176
|
|
|
133
177
|
class RaiseResult(BaseModel):
|
|
134
178
|
"""Raise a status with message and parameters result type
|
|
135
179
|
|
|
136
|
-
|
|
180
|
+
Generic result schema for utils.raise action.
|
|
137
181
|
"""
|
|
138
182
|
|
|
139
|
-
|
|
183
|
+
success: bool = True # Whether the action was successful
|
|
184
|
+
|
|
185
|
+
class Config:
|
|
186
|
+
extra = "allow" # Allow additional fields dynamically
|
|
140
187
|
|
|
141
188
|
|
|
142
189
|
class CaptureExceptionResult(BaseModel):
|
|
143
190
|
"""Capture an exception to Sentry and return an error result result type
|
|
144
191
|
|
|
145
|
-
|
|
192
|
+
Generic result schema for utils.capture_exception action.
|
|
146
193
|
"""
|
|
147
194
|
|
|
148
|
-
|
|
195
|
+
success: bool = True # Whether the action was successful
|
|
196
|
+
|
|
197
|
+
class Config:
|
|
198
|
+
extra = "allow" # Allow additional fields dynamically
|
|
149
199
|
|
|
150
200
|
|
|
151
201
|
class SendStatusResult(BaseModel):
|
|
152
202
|
"""Send a status event to the client result type
|
|
153
203
|
|
|
154
|
-
|
|
204
|
+
Generic result schema for utils.send_status action.
|
|
155
205
|
"""
|
|
156
206
|
|
|
157
|
-
|
|
207
|
+
success: bool = True # Whether the action was successful
|
|
208
|
+
|
|
209
|
+
class Config:
|
|
210
|
+
extra = "allow" # Allow additional fields dynamically
|
|
158
211
|
|
|
159
212
|
|
|
160
213
|
class WriteResult(BaseModel):
|
|
161
214
|
"""Write output message with specified content types result type
|
|
162
215
|
|
|
163
|
-
|
|
216
|
+
Generic result schema for utils.write action.
|
|
164
217
|
"""
|
|
165
218
|
|
|
166
|
-
|
|
219
|
+
success: bool = True # Whether the action was successful
|
|
167
220
|
|
|
221
|
+
class Config:
|
|
222
|
+
extra = "allow" # Allow additional fields dynamically
|
|
168
223
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
224
|
+
|
|
225
|
+
class ProcessIntegrationQueriesResult(BaseModel):
|
|
226
|
+
"""Process integration queries to create resource-specific search queries result type
|
|
227
|
+
|
|
228
|
+
Generic result schema for utils.process_integration_queries action.
|
|
229
|
+
"""
|
|
230
|
+
|
|
231
|
+
success: bool = True # Whether the action was successful
|
|
232
|
+
|
|
233
|
+
class Config:
|
|
234
|
+
extra = "allow" # Allow additional fields dynamically
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
class PopulateResourceIdsResult(BaseModel):
|
|
238
|
+
"""Assigns incremental IDs to new resources based on the maximum existing resource ID result type
|
|
239
|
+
|
|
240
|
+
Result schema for utils.populate_resource_ids action.
|
|
241
|
+
"""
|
|
242
|
+
|
|
243
|
+
new_resources: List[Resource]
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
def echo(data: Optional[Any] = None, **params: Any) -> EchoParams:
|
|
174
247
|
"""Echo parameters back as output
|
|
175
248
|
|
|
176
249
|
Args:
|
|
@@ -185,14 +258,13 @@ def echo(
|
|
|
185
258
|
# Remove None values for optional parameters
|
|
186
259
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
187
260
|
param_dict.update(params)
|
|
188
|
-
|
|
189
|
-
return
|
|
261
|
+
params_obj = EchoParams(**param_dict)
|
|
262
|
+
return params_obj
|
|
190
263
|
|
|
191
264
|
|
|
192
265
|
def parse_json(
|
|
193
266
|
json_data: Optional[Union[str, TemplateString]] = None,
|
|
194
267
|
required_keys: Optional[Any] = None,
|
|
195
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
196
268
|
**params: Any,
|
|
197
269
|
) -> ParseJsonParams:
|
|
198
270
|
"""Parse JSON string and validate required keys
|
|
@@ -211,15 +283,12 @@ def parse_json(
|
|
|
211
283
|
# Remove None values for optional parameters
|
|
212
284
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
213
285
|
param_dict.update(params)
|
|
214
|
-
|
|
215
|
-
return
|
|
286
|
+
params_obj = ParseJsonParams(**param_dict)
|
|
287
|
+
return params_obj
|
|
216
288
|
|
|
217
289
|
|
|
218
290
|
def concat(
|
|
219
|
-
concat: Optional[Any] = None,
|
|
220
|
-
data: Optional[Any] = None,
|
|
221
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
222
|
-
**params: Any,
|
|
291
|
+
concat: Optional[Any] = None, data: Optional[Any] = None, **params: Any
|
|
223
292
|
) -> ConcatParams:
|
|
224
293
|
"""Concatenate arrays or strings from specified keys
|
|
225
294
|
|
|
@@ -237,14 +306,13 @@ def concat(
|
|
|
237
306
|
# Remove None values for optional parameters
|
|
238
307
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
239
308
|
param_dict.update(params)
|
|
240
|
-
|
|
241
|
-
return
|
|
309
|
+
params_obj = ConcatParams(**param_dict)
|
|
310
|
+
return params_obj
|
|
242
311
|
|
|
243
312
|
|
|
244
313
|
def cast(
|
|
245
314
|
value: Optional[Union[str, TemplateString]] = None,
|
|
246
315
|
type_name: Optional[Union[str, TemplateString]] = None,
|
|
247
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
248
316
|
**params: Any,
|
|
249
317
|
) -> CastParams:
|
|
250
318
|
"""Cast string values to different types (string, integer, float, bool)
|
|
@@ -263,15 +331,14 @@ def cast(
|
|
|
263
331
|
# Remove None values for optional parameters
|
|
264
332
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
265
333
|
param_dict.update(params)
|
|
266
|
-
|
|
267
|
-
return
|
|
334
|
+
params_obj = CastParams(**param_dict)
|
|
335
|
+
return params_obj
|
|
268
336
|
|
|
269
337
|
|
|
270
338
|
def raise_error(
|
|
271
339
|
status: Optional[Union[str, TemplateString]] = None,
|
|
272
340
|
message: Optional[Union[str, TemplateString]] = None,
|
|
273
341
|
parameters: Optional[Any] = None,
|
|
274
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
275
342
|
**params: Any,
|
|
276
343
|
) -> RaiseParams:
|
|
277
344
|
"""Raise a status with message and parameters
|
|
@@ -292,15 +359,14 @@ def raise_error(
|
|
|
292
359
|
# Remove None values for optional parameters
|
|
293
360
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
294
361
|
param_dict.update(params)
|
|
295
|
-
|
|
296
|
-
return
|
|
362
|
+
params_obj = RaiseParams(**param_dict)
|
|
363
|
+
return params_obj
|
|
297
364
|
|
|
298
365
|
|
|
299
366
|
def capture_exception(
|
|
300
367
|
exception: Optional[Union[str, TemplateString]] = None,
|
|
301
368
|
message: Optional[Union[str, TemplateString]] = None,
|
|
302
369
|
error_type: Optional[Union[str, TemplateString]] = None,
|
|
303
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
304
370
|
**params: Any,
|
|
305
371
|
) -> CaptureExceptionParams:
|
|
306
372
|
"""Capture an exception to Sentry and return an error result
|
|
@@ -321,15 +387,14 @@ def capture_exception(
|
|
|
321
387
|
# Remove None values for optional parameters
|
|
322
388
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
323
389
|
param_dict.update(params)
|
|
324
|
-
|
|
325
|
-
return
|
|
390
|
+
params_obj = CaptureExceptionParams(**param_dict)
|
|
391
|
+
return params_obj
|
|
326
392
|
|
|
327
393
|
|
|
328
394
|
def send_status(
|
|
329
395
|
status: Optional[Union[str, TemplateString]] = None,
|
|
330
396
|
message: Optional[Union[str, TemplateString]] = None,
|
|
331
397
|
details: Optional[Any] = None,
|
|
332
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
333
398
|
**params: Any,
|
|
334
399
|
) -> SendStatusParams:
|
|
335
400
|
"""Send a status event to the client
|
|
@@ -350,8 +415,8 @@ def send_status(
|
|
|
350
415
|
# Remove None values for optional parameters
|
|
351
416
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
352
417
|
param_dict.update(params)
|
|
353
|
-
|
|
354
|
-
return
|
|
418
|
+
params_obj = SendStatusParams(**param_dict)
|
|
419
|
+
return params_obj
|
|
355
420
|
|
|
356
421
|
|
|
357
422
|
def write(
|
|
@@ -359,7 +424,7 @@ def write(
|
|
|
359
424
|
content_type: Optional[Union[str, TemplateString]] = None,
|
|
360
425
|
history_content_type: Optional[Union[str, TemplateString]] = None,
|
|
361
426
|
ui_content_type: Optional[Union[str, TemplateString]] = None,
|
|
362
|
-
|
|
427
|
+
output_channels: Optional[Any] = None,
|
|
363
428
|
**params: Any,
|
|
364
429
|
) -> WriteParams:
|
|
365
430
|
"""Write output message with specified content types
|
|
@@ -369,6 +434,7 @@ def write(
|
|
|
369
434
|
content_type: content_type parameter
|
|
370
435
|
history_content_type: history_content_type parameter
|
|
371
436
|
ui_content_type: ui_content_type parameter
|
|
437
|
+
output_channels: output_channels parameter
|
|
372
438
|
|
|
373
439
|
Returns:
|
|
374
440
|
WriteParams: Type-safe parameter object
|
|
@@ -378,12 +444,66 @@ def write(
|
|
|
378
444
|
"content_type": content_type,
|
|
379
445
|
"history_content_type": history_content_type,
|
|
380
446
|
"ui_content_type": ui_content_type,
|
|
447
|
+
"output_channels": output_channels,
|
|
448
|
+
}
|
|
449
|
+
# Remove None values for optional parameters
|
|
450
|
+
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
451
|
+
param_dict.update(params)
|
|
452
|
+
params_obj = WriteParams(**param_dict)
|
|
453
|
+
return params_obj
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
def process_integration_queries(
|
|
457
|
+
query: Optional[Union[str, TemplateString]] = None,
|
|
458
|
+
resource: Optional[Any] = None,
|
|
459
|
+
queries: Optional[Any] = None,
|
|
460
|
+
**params: Any,
|
|
461
|
+
) -> ProcessIntegrationQueriesParams:
|
|
462
|
+
"""Process integration queries to create resource-specific search queries
|
|
463
|
+
|
|
464
|
+
Args:
|
|
465
|
+
query: query parameter
|
|
466
|
+
resource: resource parameter
|
|
467
|
+
queries: queries parameter
|
|
468
|
+
|
|
469
|
+
Returns:
|
|
470
|
+
ProcessIntegrationQueriesParams: Type-safe parameter object
|
|
471
|
+
"""
|
|
472
|
+
param_dict = {
|
|
473
|
+
"query": query,
|
|
474
|
+
"resource": resource,
|
|
475
|
+
"queries": queries,
|
|
381
476
|
}
|
|
382
477
|
# Remove None values for optional parameters
|
|
383
478
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
384
479
|
param_dict.update(params)
|
|
480
|
+
params_obj = ProcessIntegrationQueriesParams(**param_dict)
|
|
481
|
+
return params_obj
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
def populate_resource_ids(
|
|
485
|
+
all_resources: Optional[Any] = None,
|
|
486
|
+
new_resources: Optional[Any] = None,
|
|
487
|
+
**params: Any,
|
|
488
|
+
) -> PopulateResourceIdsParams:
|
|
489
|
+
"""Assigns incremental IDs to new resources based on the maximum existing resource ID
|
|
490
|
+
|
|
491
|
+
Args:
|
|
492
|
+
all_resources: all_resources parameter
|
|
493
|
+
new_resources: new_resources parameter
|
|
385
494
|
|
|
386
|
-
|
|
495
|
+
Returns:
|
|
496
|
+
PopulateResourceIdsParams: Type-safe parameter object
|
|
497
|
+
"""
|
|
498
|
+
param_dict = {
|
|
499
|
+
"all_resources": all_resources,
|
|
500
|
+
"new_resources": new_resources,
|
|
501
|
+
}
|
|
502
|
+
# Remove None values for optional parameters
|
|
503
|
+
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
504
|
+
param_dict.update(params)
|
|
505
|
+
params_obj = PopulateResourceIdsParams(**param_dict)
|
|
506
|
+
return params_obj
|
|
387
507
|
|
|
388
508
|
|
|
389
509
|
# Associate parameter classes with their result types
|
|
@@ -395,3 +515,5 @@ RaiseParams._result = RaiseResult
|
|
|
395
515
|
CaptureExceptionParams._result = CaptureExceptionResult
|
|
396
516
|
SendStatusParams._result = SendStatusResult
|
|
397
517
|
WriteParams._result = WriteResult
|
|
518
|
+
ProcessIntegrationQueriesParams._result = ProcessIntegrationQueriesResult
|
|
519
|
+
PopulateResourceIdsParams._result = PopulateResourceIdsResult
|
|
@@ -11,10 +11,21 @@ from typing import Any, Optional, Union
|
|
|
11
11
|
from pydantic import BaseModel
|
|
12
12
|
|
|
13
13
|
from erdo.template import TemplateString
|
|
14
|
-
from erdo.types import StepMetadata
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
class
|
|
16
|
+
class BaseActionParams(BaseModel):
|
|
17
|
+
"""Base class for all action parameter classes.
|
|
18
|
+
|
|
19
|
+
Provides common fields that all actions support:
|
|
20
|
+
- name: The action type identifier
|
|
21
|
+
- step_metadata: Optional configuration for the step created from this action
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
name: str
|
|
25
|
+
step_metadata: Optional[Any] = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ParseParams(BaseActionParams):
|
|
18
29
|
"""Parse website content using Jina's reader API to extract text, images, and links parameters"""
|
|
19
30
|
|
|
20
31
|
name: str = "webparser.parse" # Action type for roundtrip compatibility
|
|
@@ -66,7 +77,6 @@ def parse(
|
|
|
66
77
|
return_format: Optional[Union[str, TemplateString]] = None,
|
|
67
78
|
timeout: Optional[Union[int, TemplateString]] = None,
|
|
68
79
|
no_cache: Optional[Union[bool, TemplateString]] = None,
|
|
69
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
70
80
|
**params: Any,
|
|
71
81
|
) -> ParseParams:
|
|
72
82
|
"""Parse website content using Jina's reader API to extract text, images, and links
|
|
@@ -101,8 +111,8 @@ def parse(
|
|
|
101
111
|
# Remove None values for optional parameters
|
|
102
112
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
103
113
|
param_dict.update(params)
|
|
104
|
-
|
|
105
|
-
return
|
|
114
|
+
params_obj = ParseParams(**param_dict)
|
|
115
|
+
return params_obj
|
|
106
116
|
|
|
107
117
|
|
|
108
118
|
# Associate parameter classes with their result types
|
|
@@ -11,10 +11,21 @@ from typing import Any, List, Optional, Union
|
|
|
11
11
|
from pydantic import BaseModel
|
|
12
12
|
|
|
13
13
|
from erdo.template import TemplateString
|
|
14
|
-
from erdo.types import StepMetadata
|
|
15
14
|
|
|
16
15
|
|
|
17
|
-
class
|
|
16
|
+
class BaseActionParams(BaseModel):
|
|
17
|
+
"""Base class for all action parameter classes.
|
|
18
|
+
|
|
19
|
+
Provides common fields that all actions support:
|
|
20
|
+
- name: The action type identifier
|
|
21
|
+
- step_metadata: Optional configuration for the step created from this action
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
name: str
|
|
25
|
+
step_metadata: Optional[Any] = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class SearchParams(BaseActionParams):
|
|
18
29
|
"""Search the web using Jina's search API and return relevant results parameters"""
|
|
19
30
|
|
|
20
31
|
name: str = "websearch.search" # Action type for roundtrip compatibility
|
|
@@ -42,7 +53,6 @@ def search(
|
|
|
42
53
|
country: Optional[Union[str, TemplateString]] = None,
|
|
43
54
|
location: Optional[Union[str, TemplateString]] = None,
|
|
44
55
|
num_results: Optional[Union[int, TemplateString]] = None,
|
|
45
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
46
56
|
**params: Any,
|
|
47
57
|
) -> SearchParams:
|
|
48
58
|
"""Search the web using Jina's search API and return relevant results
|
|
@@ -67,8 +77,8 @@ def search(
|
|
|
67
77
|
# Remove None values for optional parameters
|
|
68
78
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
69
79
|
param_dict.update(params)
|
|
70
|
-
|
|
71
|
-
return
|
|
80
|
+
params_obj = SearchParams(**param_dict)
|
|
81
|
+
return params_obj
|
|
72
82
|
|
|
73
83
|
|
|
74
84
|
# Associate parameter classes with their result types
|