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
|
@@ -6,16 +6,27 @@ Provides type-safe action definitions for memory 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
|
-
from pydantic import BaseModel
|
|
11
|
+
from pydantic import BaseModel, Field
|
|
12
12
|
|
|
13
13
|
from erdo._generated.types import Memory
|
|
14
14
|
from erdo.template import TemplateString
|
|
15
|
-
from erdo.types import StepMetadata
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
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 SearchParams(BaseActionParams):
|
|
19
30
|
"""Search memories using semantic search with optional filters parameters"""
|
|
20
31
|
|
|
21
32
|
name: str = "memory.search" # Action type for roundtrip compatibility
|
|
@@ -29,6 +40,13 @@ class SearchParams(BaseModel):
|
|
|
29
40
|
integration_config_id: Optional[Union[str, TemplateString]] = (
|
|
30
41
|
None # integration_config_id parameter
|
|
31
42
|
)
|
|
43
|
+
dataset_scope: Optional[Union[str, TemplateString]] = (
|
|
44
|
+
None # dataset_scope parameter
|
|
45
|
+
)
|
|
46
|
+
integration_config_scope: Optional[Union[str, TemplateString]] = (
|
|
47
|
+
None # integration_config_scope parameter
|
|
48
|
+
)
|
|
49
|
+
thread_scope: Optional[Union[str, TemplateString]] = None # thread_scope parameter
|
|
32
50
|
approval_status: Optional[Union[str, TemplateString]] = (
|
|
33
51
|
None # approval_status parameter
|
|
34
52
|
)
|
|
@@ -36,7 +54,7 @@ class SearchParams(BaseModel):
|
|
|
36
54
|
max_distance: Optional[Any] = None # max_distance parameter
|
|
37
55
|
|
|
38
56
|
|
|
39
|
-
class SearchFromQueriesParams(
|
|
57
|
+
class SearchFromQueriesParams(BaseActionParams):
|
|
40
58
|
"""Search memories using multiple queries including integration-specific queries parameters"""
|
|
41
59
|
|
|
42
60
|
name: str = "memory.search_from_queries" # Action type for roundtrip compatibility
|
|
@@ -46,27 +64,79 @@ class SearchFromQueriesParams(BaseModel):
|
|
|
46
64
|
None # organization_scope parameter
|
|
47
65
|
)
|
|
48
66
|
user_scope: Optional[Union[str, TemplateString]] = None # user_scope parameter
|
|
67
|
+
user_id: Optional[Union[str, TemplateString]] = None # user_id parameter
|
|
49
68
|
thread_id: Optional[Union[str, TemplateString]] = None # thread_id parameter
|
|
50
69
|
limit: Optional[Union[int, TemplateString]] = None # limit parameter
|
|
51
70
|
max_distance: Optional[Any] = None # max_distance parameter
|
|
71
|
+
authorizers: Optional[Any] = None # authorizers parameter
|
|
52
72
|
|
|
53
73
|
|
|
54
|
-
class
|
|
55
|
-
"""
|
|
74
|
+
class StoreParams(BaseActionParams):
|
|
75
|
+
"""Store or update a memory with content, metadata, and scope settings parameters"""
|
|
76
|
+
|
|
77
|
+
name: str = "memory.store" # Action type for roundtrip compatibility
|
|
78
|
+
memory: Optional[Any] = None # memory parameter
|
|
79
|
+
|
|
56
80
|
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
class UpdateParams(BaseActionParams):
|
|
82
|
+
"""Update an existing memory with new content, metadata, or scope settings parameters"""
|
|
83
|
+
|
|
84
|
+
model_config = {"populate_by_name": True} # Allow both field names and aliases
|
|
85
|
+
|
|
86
|
+
name: str = "memory.update" # Action type for roundtrip compatibility
|
|
87
|
+
id_value: Optional[Union[str, TemplateString]] = Field(
|
|
88
|
+
default=None, alias="id"
|
|
89
|
+
) # id parameter
|
|
90
|
+
content: Optional[Union[str, TemplateString]] = None # content parameter
|
|
91
|
+
description: Optional[Union[str, TemplateString]] = None # description parameter
|
|
92
|
+
type_name: Optional[Union[str, TemplateString]] = Field(
|
|
93
|
+
default=None, alias="type"
|
|
94
|
+
) # type parameter
|
|
95
|
+
searchable_texts: Optional[Any] = None # searchable_texts parameter
|
|
96
|
+
tags: Optional[Any] = None # tags parameter
|
|
97
|
+
created_from: Optional[Union[str, TemplateString]] = None # created_from parameter
|
|
98
|
+
created_by_entity_type: Optional[Union[str, TemplateString]] = (
|
|
99
|
+
None # created_by_entity_type parameter
|
|
59
100
|
)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
101
|
+
integration_config_id: Optional[Union[str, TemplateString]] = (
|
|
102
|
+
None # integration_config_id parameter
|
|
103
|
+
)
|
|
104
|
+
dataset_id: Optional[Union[str, TemplateString]] = None # dataset_id parameter
|
|
105
|
+
thread_id: Optional[Union[str, TemplateString]] = None # thread_id parameter
|
|
106
|
+
is_organization_specific: Optional[Union[bool, TemplateString]] = (
|
|
107
|
+
None # is_organization_specific parameter
|
|
108
|
+
)
|
|
109
|
+
is_user_specific: Optional[Union[bool, TemplateString]] = (
|
|
110
|
+
None # is_user_specific parameter
|
|
111
|
+
)
|
|
112
|
+
estimated_stale_at: Optional[Union[str, TemplateString]] = (
|
|
113
|
+
None # estimated_stale_at parameter
|
|
114
|
+
)
|
|
115
|
+
stale_when_text: Optional[Union[str, TemplateString]] = (
|
|
116
|
+
None # stale_when_text parameter
|
|
117
|
+
)
|
|
118
|
+
extra: Optional[Any] = None # extra parameter
|
|
63
119
|
|
|
64
120
|
|
|
65
|
-
class
|
|
66
|
-
"""
|
|
121
|
+
class DeleteParams(BaseActionParams):
|
|
122
|
+
"""Soft delete a memory by marking it as deleted parameters"""
|
|
67
123
|
|
|
68
|
-
|
|
69
|
-
|
|
124
|
+
model_config = {"populate_by_name": True} # Allow both field names and aliases
|
|
125
|
+
|
|
126
|
+
name: str = "memory.delete" # Action type for roundtrip compatibility
|
|
127
|
+
id_value: Optional[Union[str, TemplateString]] = Field(
|
|
128
|
+
default=None, alias="id"
|
|
129
|
+
) # id parameter
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class MarkAsDedupedParams(BaseActionParams):
|
|
133
|
+
"""Mark memories as deduplicated by another memory parameters"""
|
|
134
|
+
|
|
135
|
+
name: str = "memory.mark_as_deduped" # Action type for roundtrip compatibility
|
|
136
|
+
memory_ids: Optional[Any] = None # memory_ids parameter
|
|
137
|
+
deduped_by_id: Optional[Union[str, TemplateString]] = (
|
|
138
|
+
None # deduped_by_id parameter
|
|
139
|
+
)
|
|
70
140
|
|
|
71
141
|
|
|
72
142
|
class SearchResult(BaseModel):
|
|
@@ -81,19 +151,13 @@ class SearchResult(BaseModel):
|
|
|
81
151
|
class SearchFromQueriesResult(BaseModel):
|
|
82
152
|
"""Search memories using multiple queries including integration-specific queries result type
|
|
83
153
|
|
|
84
|
-
|
|
154
|
+
Generic result schema for memory.search_from_queries action.
|
|
85
155
|
"""
|
|
86
156
|
|
|
87
|
-
|
|
157
|
+
success: bool = True # Whether the action was successful
|
|
88
158
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"""Process integration queries to create resource-specific search queries result type
|
|
92
|
-
|
|
93
|
-
Result schema for memory.process_integration_queries action.
|
|
94
|
-
"""
|
|
95
|
-
|
|
96
|
-
data: Optional[Dict[str, Any]] # Action result data
|
|
159
|
+
class Config:
|
|
160
|
+
extra = "allow" # Allow additional fields dynamically
|
|
97
161
|
|
|
98
162
|
|
|
99
163
|
class StoreResult(BaseModel):
|
|
@@ -105,6 +169,42 @@ class StoreResult(BaseModel):
|
|
|
105
169
|
memory: Any
|
|
106
170
|
|
|
107
171
|
|
|
172
|
+
class UpdateResult(BaseModel):
|
|
173
|
+
"""Update an existing memory with new content, metadata, or scope settings result type
|
|
174
|
+
|
|
175
|
+
Generic result schema for memory.update action.
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
success: bool = True # Whether the action was successful
|
|
179
|
+
|
|
180
|
+
class Config:
|
|
181
|
+
extra = "allow" # Allow additional fields dynamically
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class DeleteResult(BaseModel):
|
|
185
|
+
"""Soft delete a memory by marking it as deleted result type
|
|
186
|
+
|
|
187
|
+
Generic result schema for memory.delete action.
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
success: bool = True # Whether the action was successful
|
|
191
|
+
|
|
192
|
+
class Config:
|
|
193
|
+
extra = "allow" # Allow additional fields dynamically
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
class MarkAsDedupedResult(BaseModel):
|
|
197
|
+
"""Mark memories as deduplicated by another memory result type
|
|
198
|
+
|
|
199
|
+
Generic result schema for memory.mark_as_deduped action.
|
|
200
|
+
"""
|
|
201
|
+
|
|
202
|
+
success: bool = True # Whether the action was successful
|
|
203
|
+
|
|
204
|
+
class Config:
|
|
205
|
+
extra = "allow" # Allow additional fields dynamically
|
|
206
|
+
|
|
207
|
+
|
|
108
208
|
def search(
|
|
109
209
|
query: Optional[Union[str, TemplateString]] = None,
|
|
110
210
|
organization_scope: Optional[Union[str, TemplateString]] = None,
|
|
@@ -112,10 +212,12 @@ def search(
|
|
|
112
212
|
thread_id: Optional[Union[str, TemplateString]] = None,
|
|
113
213
|
dataset_id: Optional[Union[str, TemplateString]] = None,
|
|
114
214
|
integration_config_id: Optional[Union[str, TemplateString]] = None,
|
|
215
|
+
dataset_scope: Optional[Union[str, TemplateString]] = None,
|
|
216
|
+
integration_config_scope: Optional[Union[str, TemplateString]] = None,
|
|
217
|
+
thread_scope: Optional[Union[str, TemplateString]] = None,
|
|
115
218
|
approval_status: Optional[Union[str, TemplateString]] = None,
|
|
116
219
|
limit: Optional[Union[int, TemplateString]] = None,
|
|
117
220
|
max_distance: Optional[Any] = None,
|
|
118
|
-
step_metadata: Optional[StepMetadata] = None,
|
|
119
221
|
**params: Any,
|
|
120
222
|
) -> SearchParams:
|
|
121
223
|
"""Search memories using semantic search with optional filters
|
|
@@ -127,6 +229,9 @@ def search(
|
|
|
127
229
|
thread_id: thread_id parameter
|
|
128
230
|
dataset_id: dataset_id parameter
|
|
129
231
|
integration_config_id: integration_config_id parameter
|
|
232
|
+
dataset_scope: dataset_scope parameter
|
|
233
|
+
integration_config_scope: integration_config_scope parameter
|
|
234
|
+
thread_scope: thread_scope parameter
|
|
130
235
|
approval_status: approval_status parameter
|
|
131
236
|
limit: limit parameter
|
|
132
237
|
max_distance: max_distance parameter
|
|
@@ -141,6 +246,9 @@ def search(
|
|
|
141
246
|
"thread_id": thread_id,
|
|
142
247
|
"dataset_id": dataset_id,
|
|
143
248
|
"integration_config_id": integration_config_id,
|
|
249
|
+
"dataset_scope": dataset_scope,
|
|
250
|
+
"integration_config_scope": integration_config_scope,
|
|
251
|
+
"thread_scope": thread_scope,
|
|
144
252
|
"approval_status": approval_status,
|
|
145
253
|
"limit": limit,
|
|
146
254
|
"max_distance": max_distance,
|
|
@@ -148,8 +256,8 @@ def search(
|
|
|
148
256
|
# Remove None values for optional parameters
|
|
149
257
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
150
258
|
param_dict.update(params)
|
|
151
|
-
|
|
152
|
-
return
|
|
259
|
+
params_obj = SearchParams(**param_dict)
|
|
260
|
+
return params_obj
|
|
153
261
|
|
|
154
262
|
|
|
155
263
|
def search_from_queries(
|
|
@@ -157,10 +265,11 @@ def search_from_queries(
|
|
|
157
265
|
integration_queries: Optional[Any] = None,
|
|
158
266
|
organization_scope: Optional[Union[str, TemplateString]] = None,
|
|
159
267
|
user_scope: Optional[Union[str, TemplateString]] = None,
|
|
268
|
+
user_id: Optional[Union[str, TemplateString]] = None,
|
|
160
269
|
thread_id: Optional[Union[str, TemplateString]] = None,
|
|
161
270
|
limit: Optional[Union[int, TemplateString]] = None,
|
|
162
271
|
max_distance: Optional[Any] = None,
|
|
163
|
-
|
|
272
|
+
authorizers: Optional[Any] = None,
|
|
164
273
|
**params: Any,
|
|
165
274
|
) -> SearchFromQueriesParams:
|
|
166
275
|
"""Search memories using multiple queries including integration-specific queries
|
|
@@ -170,9 +279,11 @@ def search_from_queries(
|
|
|
170
279
|
integration_queries: integration_queries parameter
|
|
171
280
|
organization_scope: organization_scope parameter
|
|
172
281
|
user_scope: user_scope parameter
|
|
282
|
+
user_id: user_id parameter
|
|
173
283
|
thread_id: thread_id parameter
|
|
174
284
|
limit: limit parameter
|
|
175
285
|
max_distance: max_distance parameter
|
|
286
|
+
authorizers: authorizers parameter
|
|
176
287
|
|
|
177
288
|
Returns:
|
|
178
289
|
SearchFromQueriesParams: Type-safe parameter object
|
|
@@ -182,71 +293,155 @@ def search_from_queries(
|
|
|
182
293
|
"integration_queries": integration_queries,
|
|
183
294
|
"organization_scope": organization_scope,
|
|
184
295
|
"user_scope": user_scope,
|
|
296
|
+
"user_id": user_id,
|
|
185
297
|
"thread_id": thread_id,
|
|
186
298
|
"limit": limit,
|
|
187
299
|
"max_distance": max_distance,
|
|
300
|
+
"authorizers": authorizers,
|
|
188
301
|
}
|
|
189
302
|
# Remove None values for optional parameters
|
|
190
303
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
191
304
|
param_dict.update(params)
|
|
305
|
+
params_obj = SearchFromQueriesParams(**param_dict)
|
|
306
|
+
return params_obj
|
|
192
307
|
|
|
193
|
-
return SearchFromQueriesParams(**param_dict)
|
|
194
308
|
|
|
309
|
+
def store(memory: Optional[Any] = None, **params: Any) -> StoreParams:
|
|
310
|
+
"""Store or update a memory with content, metadata, and scope settings
|
|
195
311
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
312
|
+
Args:
|
|
313
|
+
memory: memory parameter
|
|
314
|
+
|
|
315
|
+
Returns:
|
|
316
|
+
StoreParams: Type-safe parameter object
|
|
317
|
+
"""
|
|
318
|
+
param_dict = {
|
|
319
|
+
"memory": memory,
|
|
320
|
+
}
|
|
321
|
+
# Remove None values for optional parameters
|
|
322
|
+
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
323
|
+
param_dict.update(params)
|
|
324
|
+
params_obj = StoreParams(**param_dict)
|
|
325
|
+
return params_obj
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def update(
|
|
329
|
+
id_value: Optional[Union[str, TemplateString]] = None,
|
|
330
|
+
content: Optional[Union[str, TemplateString]] = None,
|
|
331
|
+
description: Optional[Union[str, TemplateString]] = None,
|
|
332
|
+
type_name: Optional[Union[str, TemplateString]] = None,
|
|
333
|
+
searchable_texts: Optional[Any] = None,
|
|
334
|
+
tags: Optional[Any] = None,
|
|
335
|
+
created_from: Optional[Union[str, TemplateString]] = None,
|
|
336
|
+
created_by_entity_type: Optional[Union[str, TemplateString]] = None,
|
|
337
|
+
integration_config_id: Optional[Union[str, TemplateString]] = None,
|
|
338
|
+
dataset_id: Optional[Union[str, TemplateString]] = None,
|
|
339
|
+
thread_id: Optional[Union[str, TemplateString]] = None,
|
|
340
|
+
is_organization_specific: Optional[Union[bool, TemplateString]] = None,
|
|
341
|
+
is_user_specific: Optional[Union[bool, TemplateString]] = None,
|
|
342
|
+
estimated_stale_at: Optional[Union[str, TemplateString]] = None,
|
|
343
|
+
stale_when_text: Optional[Union[str, TemplateString]] = None,
|
|
344
|
+
extra: Optional[Any] = None,
|
|
201
345
|
**params: Any,
|
|
202
|
-
) ->
|
|
203
|
-
"""
|
|
346
|
+
) -> UpdateParams:
|
|
347
|
+
"""Update an existing memory with new content, metadata, or scope settings
|
|
204
348
|
|
|
205
349
|
Args:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
350
|
+
id_value: id parameter
|
|
351
|
+
content: content parameter
|
|
352
|
+
description: description parameter
|
|
353
|
+
type_name: type parameter
|
|
354
|
+
searchable_texts: searchable_texts parameter
|
|
355
|
+
tags: tags parameter
|
|
356
|
+
created_from: created_from parameter
|
|
357
|
+
created_by_entity_type: created_by_entity_type parameter
|
|
358
|
+
integration_config_id: integration_config_id parameter
|
|
359
|
+
dataset_id: dataset_id parameter
|
|
360
|
+
thread_id: thread_id parameter
|
|
361
|
+
is_organization_specific: is_organization_specific parameter
|
|
362
|
+
is_user_specific: is_user_specific parameter
|
|
363
|
+
estimated_stale_at: estimated_stale_at parameter
|
|
364
|
+
stale_when_text: stale_when_text parameter
|
|
365
|
+
extra: extra parameter
|
|
209
366
|
|
|
210
367
|
Returns:
|
|
211
|
-
|
|
368
|
+
UpdateParams: Type-safe parameter object
|
|
212
369
|
"""
|
|
213
370
|
param_dict = {
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"
|
|
371
|
+
"id": id_value,
|
|
372
|
+
"content": content,
|
|
373
|
+
"description": description,
|
|
374
|
+
"type": type_name,
|
|
375
|
+
"searchable_texts": searchable_texts,
|
|
376
|
+
"tags": tags,
|
|
377
|
+
"created_from": created_from,
|
|
378
|
+
"created_by_entity_type": created_by_entity_type,
|
|
379
|
+
"integration_config_id": integration_config_id,
|
|
380
|
+
"dataset_id": dataset_id,
|
|
381
|
+
"thread_id": thread_id,
|
|
382
|
+
"is_organization_specific": is_organization_specific,
|
|
383
|
+
"is_user_specific": is_user_specific,
|
|
384
|
+
"estimated_stale_at": estimated_stale_at,
|
|
385
|
+
"stale_when_text": stale_when_text,
|
|
386
|
+
"extra": extra,
|
|
217
387
|
}
|
|
218
388
|
# Remove None values for optional parameters
|
|
219
389
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
220
390
|
param_dict.update(params)
|
|
391
|
+
params_obj = UpdateParams(**param_dict)
|
|
392
|
+
return params_obj
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def delete(
|
|
396
|
+
id_value: Optional[Union[str, TemplateString]] = None, **params: Any
|
|
397
|
+
) -> DeleteParams:
|
|
398
|
+
"""Soft delete a memory by marking it as deleted
|
|
399
|
+
|
|
400
|
+
Args:
|
|
401
|
+
id_value: id parameter
|
|
221
402
|
|
|
222
|
-
|
|
403
|
+
Returns:
|
|
404
|
+
DeleteParams: Type-safe parameter object
|
|
405
|
+
"""
|
|
406
|
+
param_dict = {
|
|
407
|
+
"id": id_value,
|
|
408
|
+
}
|
|
409
|
+
# Remove None values for optional parameters
|
|
410
|
+
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
411
|
+
param_dict.update(params)
|
|
412
|
+
params_obj = DeleteParams(**param_dict)
|
|
413
|
+
return params_obj
|
|
223
414
|
|
|
224
415
|
|
|
225
|
-
def
|
|
226
|
-
|
|
227
|
-
|
|
416
|
+
def mark_as_deduped(
|
|
417
|
+
memory_ids: Optional[Any] = None,
|
|
418
|
+
deduped_by_id: Optional[Union[str, TemplateString]] = None,
|
|
228
419
|
**params: Any,
|
|
229
|
-
) ->
|
|
230
|
-
"""
|
|
420
|
+
) -> MarkAsDedupedParams:
|
|
421
|
+
"""Mark memories as deduplicated by another memory
|
|
231
422
|
|
|
232
423
|
Args:
|
|
233
|
-
|
|
424
|
+
memory_ids: memory_ids parameter
|
|
425
|
+
deduped_by_id: deduped_by_id parameter
|
|
234
426
|
|
|
235
427
|
Returns:
|
|
236
|
-
|
|
428
|
+
MarkAsDedupedParams: Type-safe parameter object
|
|
237
429
|
"""
|
|
238
430
|
param_dict = {
|
|
239
|
-
"
|
|
431
|
+
"memory_ids": memory_ids,
|
|
432
|
+
"deduped_by_id": deduped_by_id,
|
|
240
433
|
}
|
|
241
434
|
# Remove None values for optional parameters
|
|
242
435
|
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
243
436
|
param_dict.update(params)
|
|
244
|
-
|
|
245
|
-
return
|
|
437
|
+
params_obj = MarkAsDedupedParams(**param_dict)
|
|
438
|
+
return params_obj
|
|
246
439
|
|
|
247
440
|
|
|
248
441
|
# Associate parameter classes with their result types
|
|
249
442
|
SearchParams._result = SearchResult
|
|
250
443
|
SearchFromQueriesParams._result = SearchFromQueriesResult
|
|
251
|
-
ProcessIntegrationQueriesParams._result = ProcessIntegrationQueriesResult
|
|
252
444
|
StoreParams._result = StoreResult
|
|
445
|
+
UpdateParams._result = UpdateResult
|
|
446
|
+
DeleteParams._result = DeleteResult
|
|
447
|
+
MarkAsDedupedParams._result = MarkAsDedupedResult
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"""
|
|
2
|
+
PDF extraction actions for extracting tables and text from PDF documents using Document AI and Gemini service functions.
|
|
3
|
+
Auto-generated - DO NOT EDIT.
|
|
4
|
+
|
|
5
|
+
Provides type-safe action definitions for pdfextractor service.
|
|
6
|
+
Actual execution happens in the Go backend after syncing.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Any, Dict, List, Optional, Union
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel
|
|
12
|
+
|
|
13
|
+
from erdo.template import TemplateString
|
|
14
|
+
from erdo.types import StepMetadata
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ExtractParams(BaseModel):
|
|
18
|
+
"""Extract tables and text from PDF documents using Google Document AI with Gemini fallback parameters"""
|
|
19
|
+
|
|
20
|
+
name: str = "pdfextractor.extract" # Action type for roundtrip compatibility
|
|
21
|
+
file_path: Optional[Union[str, TemplateString]] = None # file_path parameter
|
|
22
|
+
url: Optional[Union[str, TemplateString]] = None # url parameter
|
|
23
|
+
dataset_id: Optional[Union[str, TemplateString]] = None # dataset_id parameter
|
|
24
|
+
content: Optional[Union[str, TemplateString]] = None # content parameter
|
|
25
|
+
extract_tables: Optional[Union[bool, TemplateString]] = (
|
|
26
|
+
None # extract_tables parameter
|
|
27
|
+
)
|
|
28
|
+
extract_text: Optional[Union[bool, TemplateString]] = None # extract_text parameter
|
|
29
|
+
fallback_to_gemini: Optional[Union[bool, TemplateString]] = (
|
|
30
|
+
None # fallback_to_gemini parameter
|
|
31
|
+
)
|
|
32
|
+
timeout_seconds: Optional[Union[int, TemplateString]] = (
|
|
33
|
+
None # timeout_seconds parameter
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ExtractResult(BaseModel):
|
|
38
|
+
"""Extract tables and text from PDF documents using Google Document AI with Gemini fallback result type
|
|
39
|
+
|
|
40
|
+
Result schema for pdfextractor.extract action.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
tables: List[Dict[str, Any]]
|
|
44
|
+
page_count: float
|
|
45
|
+
extraction_method: str
|
|
46
|
+
processing_time_ms: float
|
|
47
|
+
file_size_bytes: float
|
|
48
|
+
text: Optional[str]
|
|
49
|
+
warnings: Optional[List[str]]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def extract(
|
|
53
|
+
file_path: Optional[Union[str, TemplateString]] = None,
|
|
54
|
+
url: Optional[Union[str, TemplateString]] = None,
|
|
55
|
+
dataset_id: Optional[Union[str, TemplateString]] = None,
|
|
56
|
+
content: Optional[Union[str, TemplateString]] = None,
|
|
57
|
+
extract_tables: Optional[Union[bool, TemplateString]] = None,
|
|
58
|
+
extract_text: Optional[Union[bool, TemplateString]] = None,
|
|
59
|
+
fallback_to_gemini: Optional[Union[bool, TemplateString]] = None,
|
|
60
|
+
timeout_seconds: Optional[Union[int, TemplateString]] = None,
|
|
61
|
+
step_metadata: Optional[StepMetadata] = None,
|
|
62
|
+
**params: Any,
|
|
63
|
+
) -> ExtractParams:
|
|
64
|
+
"""Extract tables and text from PDF documents using Google Document AI with Gemini fallback
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
file_path: file_path parameter
|
|
68
|
+
url: url parameter
|
|
69
|
+
dataset_id: dataset_id parameter
|
|
70
|
+
content: content parameter
|
|
71
|
+
extract_tables: extract_tables parameter
|
|
72
|
+
extract_text: extract_text parameter
|
|
73
|
+
fallback_to_gemini: fallback_to_gemini parameter
|
|
74
|
+
timeout_seconds: timeout_seconds parameter
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
ExtractParams: Type-safe parameter object
|
|
78
|
+
"""
|
|
79
|
+
param_dict = {
|
|
80
|
+
"file_path": file_path,
|
|
81
|
+
"url": url,
|
|
82
|
+
"dataset_id": dataset_id,
|
|
83
|
+
"content": content,
|
|
84
|
+
"extract_tables": extract_tables,
|
|
85
|
+
"extract_text": extract_text,
|
|
86
|
+
"fallback_to_gemini": fallback_to_gemini,
|
|
87
|
+
"timeout_seconds": timeout_seconds,
|
|
88
|
+
}
|
|
89
|
+
# Remove None values for optional parameters
|
|
90
|
+
param_dict = {k: v for k, v in param_dict.items() if v is not None}
|
|
91
|
+
param_dict.update(params)
|
|
92
|
+
|
|
93
|
+
return ExtractParams(**param_dict)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Associate parameter classes with their result types
|
|
97
|
+
ExtractParams._result = ExtractResult
|