erdo 0.1.31__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.
Files changed (48) hide show
  1. erdo/__init__.py +35 -0
  2. erdo/_generated/__init__.py +18 -0
  3. erdo/_generated/actions/__init__.py +34 -0
  4. erdo/_generated/actions/analysis.py +179 -0
  5. erdo/_generated/actions/bot.py +186 -0
  6. erdo/_generated/actions/codeexec.py +199 -0
  7. erdo/_generated/actions/llm.py +148 -0
  8. erdo/_generated/actions/memory.py +463 -0
  9. erdo/_generated/actions/pdfextractor.py +97 -0
  10. erdo/_generated/actions/resource_definitions.py +296 -0
  11. erdo/_generated/actions/sqlexec.py +90 -0
  12. erdo/_generated/actions/utils.py +475 -0
  13. erdo/_generated/actions/webparser.py +119 -0
  14. erdo/_generated/actions/websearch.py +85 -0
  15. erdo/_generated/condition/__init__.py +556 -0
  16. erdo/_generated/internal.py +51 -0
  17. erdo/_generated/internal_actions.py +91 -0
  18. erdo/_generated/parameters.py +17 -0
  19. erdo/_generated/secrets.py +17 -0
  20. erdo/_generated/template_functions.py +55 -0
  21. erdo/_generated/types.py +3907 -0
  22. erdo/actions/__init__.py +40 -0
  23. erdo/bot_permissions.py +266 -0
  24. erdo/cli_entry.py +73 -0
  25. erdo/conditions/__init__.py +11 -0
  26. erdo/config/__init__.py +5 -0
  27. erdo/config/config.py +140 -0
  28. erdo/formatting.py +279 -0
  29. erdo/install_cli.py +140 -0
  30. erdo/integrations.py +131 -0
  31. erdo/invoke/__init__.py +11 -0
  32. erdo/invoke/client.py +234 -0
  33. erdo/invoke/invoke.py +555 -0
  34. erdo/state.py +376 -0
  35. erdo/sync/__init__.py +17 -0
  36. erdo/sync/client.py +95 -0
  37. erdo/sync/extractor.py +492 -0
  38. erdo/sync/sync.py +327 -0
  39. erdo/template.py +136 -0
  40. erdo/test/__init__.py +41 -0
  41. erdo/test/evaluate.py +272 -0
  42. erdo/test/runner.py +263 -0
  43. erdo/types.py +1431 -0
  44. erdo-0.1.31.dist-info/METADATA +471 -0
  45. erdo-0.1.31.dist-info/RECORD +48 -0
  46. erdo-0.1.31.dist-info/WHEEL +4 -0
  47. erdo-0.1.31.dist-info/entry_points.txt +2 -0
  48. erdo-0.1.31.dist-info/licenses/LICENSE +22 -0
@@ -0,0 +1,148 @@
1
+ """
2
+ LLM service functions.
3
+ Auto-generated - DO NOT EDIT.
4
+
5
+ Provides type-safe action definitions for LLM service with bot-compatible parameters.
6
+ Actual execution happens in the Go backend after syncing.
7
+
8
+ NOTE: This module is hardcoded to provide bot-compatible parameter names
9
+ that match the exported bot code format.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ from typing import Any, Dict, List, Optional, Union
15
+
16
+ from pydantic import BaseModel
17
+
18
+ from erdo._generated.types import Tool
19
+ from erdo.template import TemplateString
20
+ from erdo.types import StepMetadata
21
+
22
+
23
+ class MessageResult(BaseModel):
24
+ """LLM message result type
25
+
26
+ Result schema for llm.message action.
27
+ """
28
+
29
+ content: str # The generated response content
30
+ tool_calls: Optional[List[Any]] = None # Tool calls made by the LLM
31
+ usage: Optional[Any] = None # Token usage information
32
+ finish_reason: Optional[str] = None # Reason the generation finished
33
+
34
+
35
+ class BaseActionParams(BaseModel):
36
+ """Base class for all action parameter classes.
37
+
38
+ Provides common fields that all actions support:
39
+ - name: The action type identifier
40
+ - step_metadata: Optional configuration for the step created from this action
41
+ """
42
+
43
+ name: str
44
+ step_metadata: Optional[StepMetadata] = None
45
+
46
+
47
+ class MessageParams(BaseActionParams):
48
+ """LLM message parameters (bot-compatible)"""
49
+
50
+ name: str = "llm.message" # Action type for roundtrip compatibility
51
+
52
+ # Bot definition parameters (high-level)
53
+ system_prompt: Optional[Union[str, TemplateString]] = (
54
+ None # System prompt for the conversation
55
+ )
56
+ message_history: Optional[Union[List[Dict[str, Any]], TemplateString]] = (
57
+ None # Previous messages in the conversation
58
+ )
59
+ query: Optional[Union[str, TemplateString]] = None # User query/message
60
+ context: Optional[Union[str, TemplateString]] = None # Additional context
61
+
62
+ # LLM configuration parameters
63
+ model: Optional[Union[str, TemplateString]] = None # LLM model to use
64
+ tools: Optional[List[Tool]] = None # Available tools for the LLM
65
+ response_format: Optional[Union[Dict[str, Any], TemplateString]] = (
66
+ None # Response format specification
67
+ )
68
+ max_tokens: Optional[Union[int, TemplateString]] = (
69
+ None # Maximum tokens in response
70
+ )
71
+ metadata: Optional[Union[Dict[str, Any], TemplateString]] = (
72
+ None # Additional metadata
73
+ )
74
+ disable_tools: Optional[Union[bool, TemplateString]] = (
75
+ None # Whether to disable tools for this message
76
+ )
77
+ reasoning: Optional[Union[Dict[str, Any], TemplateString]] = (
78
+ None # Reasoning configuration for extended thinking
79
+ )
80
+
81
+
82
+ def message(
83
+ system_prompt: Optional[Union[str, TemplateString]] = None,
84
+ message_history: Optional[Union[List[Dict[str, Any]], TemplateString]] = None,
85
+ query: Optional[Union[str, TemplateString]] = None,
86
+ context: Optional[Union[str, TemplateString]] = None,
87
+ model: Optional[Union[str, TemplateString]] = None,
88
+ tools: Optional[List[Tool]] = None,
89
+ response_format: Optional[Union[Dict[str, Any], TemplateString]] = None,
90
+ max_tokens: Optional[Union[int, TemplateString]] = None,
91
+ metadata: Optional[Union[Dict[str, Any], TemplateString]] = None,
92
+ disable_tools: Optional[Union[bool, TemplateString]] = None,
93
+ reasoning: Optional[Union[Dict[str, Any], TemplateString]] = None,
94
+ step_metadata: Optional[StepMetadata] = None,
95
+ **params: Any,
96
+ ) -> MessageParams:
97
+ """Generate LLM message with bot-compatible parameters
98
+
99
+ This function accepts the same parameters that bot definitions use,
100
+ making it compatible with exported bot code.
101
+
102
+ Args:
103
+ system_prompt: System prompt for the conversation
104
+ message_history: Previous messages in the conversation
105
+ query: User query/message
106
+ context: Additional context
107
+ model: LLM model to use
108
+ tools: Available tools for the LLM
109
+ response_format: Response format specification
110
+ max_tokens: Maximum tokens in response
111
+ metadata: Additional metadata
112
+ disable_tools: Whether to disable tools for this message
113
+ reasoning: Reasoning configuration for extended thinking
114
+
115
+ Returns:
116
+ MessageParams: Type-safe parameter object
117
+ """
118
+ params_dict = {
119
+ "system_prompt": system_prompt,
120
+ "message_history": message_history,
121
+ "query": query,
122
+ "context": context,
123
+ "model": model,
124
+ "tools": tools,
125
+ "response_format": response_format,
126
+ "max_tokens": max_tokens,
127
+ "metadata": metadata,
128
+ "disable_tools": disable_tools,
129
+ "reasoning": reasoning,
130
+ }
131
+
132
+ # Remove None values for optional parameters
133
+ params_dict = {k: v for k, v in params_dict.items() if v is not None}
134
+ params_dict.update(params)
135
+
136
+ # Include step_metadata in params_dict since it's a field on BaseActionParams
137
+ if step_metadata is not None:
138
+ params_dict["step_metadata"] = step_metadata
139
+
140
+ # Use normal constructor for proper validation
141
+ return MessageParams(**params_dict)
142
+
143
+
144
+ # Rebuild models to resolve forward references (needed for Python 3.10+)
145
+ MessageParams.model_rebuild()
146
+
147
+ # Associate parameter classes with their result types
148
+ MessageParams._result = MessageResult
@@ -0,0 +1,463 @@
1
+ """
2
+ Memory management actions for storing, searching, and managing memories service functions.
3
+ Auto-generated - DO NOT EDIT.
4
+
5
+ Provides type-safe action definitions for memory service.
6
+ Actual execution happens in the Go backend after syncing.
7
+ """
8
+
9
+ from typing import Any, List, Optional, Union
10
+
11
+ from pydantic import BaseModel, Field
12
+
13
+ from erdo._generated.types import Memory
14
+ from erdo.template import TemplateString
15
+
16
+
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):
30
+ """Search memories using semantic search with optional filters parameters"""
31
+
32
+ name: str = "memory.search" # Action type for roundtrip compatibility
33
+ query: Optional[Union[str, TemplateString]] = None # query parameter
34
+ organization_scope: Optional[Union[str, TemplateString]] = (
35
+ None # organization_scope parameter
36
+ )
37
+ user_scope: Optional[Union[str, TemplateString]] = None # user_scope parameter
38
+ thread_id: Optional[Union[str, TemplateString]] = None # thread_id parameter
39
+ dataset_id: Optional[Union[str, TemplateString]] = None # dataset_id parameter
40
+ dataset_slug: Optional[Union[str, TemplateString]] = None # dataset_slug parameter
41
+ integration_config_id: Optional[Union[str, TemplateString]] = (
42
+ None # integration_config_id parameter
43
+ )
44
+ dataset_scope: Optional[Union[str, TemplateString]] = (
45
+ None # dataset_scope parameter
46
+ )
47
+ integration_config_scope: Optional[Union[str, TemplateString]] = (
48
+ None # integration_config_scope parameter
49
+ )
50
+ thread_scope: Optional[Union[str, TemplateString]] = None # thread_scope parameter
51
+ approval_status: Optional[Union[str, TemplateString]] = (
52
+ None # approval_status parameter
53
+ )
54
+ types: Optional[Any] = None # types parameter
55
+ limit: Optional[Union[int, TemplateString]] = None # limit parameter
56
+ max_distance: Optional[Any] = None # max_distance parameter
57
+ authorizers: Optional[Any] = None # authorizers parameter
58
+
59
+
60
+ class SearchFromQueriesParams(BaseActionParams):
61
+ """Search memories using multiple queries including integration-specific queries parameters"""
62
+
63
+ name: str = "memory.search_from_queries" # Action type for roundtrip compatibility
64
+ queries: Optional[Any] = None # queries parameter
65
+ integration_queries: Optional[Any] = None # integration_queries parameter
66
+ organization_scope: Optional[Union[str, TemplateString]] = (
67
+ None # organization_scope parameter
68
+ )
69
+ user_scope: Optional[Union[str, TemplateString]] = None # user_scope parameter
70
+ user_id: Optional[Union[str, TemplateString]] = None # user_id parameter
71
+ thread_id: Optional[Union[str, TemplateString]] = None # thread_id parameter
72
+ types: Optional[Any] = None # types parameter
73
+ limit: Optional[Union[int, TemplateString]] = None # limit parameter
74
+ max_distance: Optional[Any] = None # max_distance parameter
75
+ authorizers: Optional[Any] = None # authorizers parameter
76
+
77
+
78
+ class StoreParams(BaseActionParams):
79
+ """Store or update a memory with content, metadata, and scope settings parameters"""
80
+
81
+ name: str = "memory.store" # Action type for roundtrip compatibility
82
+ memory: Optional[Any] = None # memory parameter
83
+
84
+
85
+ class UpdateParams(BaseActionParams):
86
+ """Update an existing memory with new content, metadata, or scope settings parameters"""
87
+
88
+ model_config = {"populate_by_name": True} # Allow both field names and aliases
89
+
90
+ name: str = "memory.update" # Action type for roundtrip compatibility
91
+ id_value: Optional[Union[str, TemplateString]] = Field(
92
+ default=None, alias="id"
93
+ ) # id parameter
94
+ content: Optional[Union[str, TemplateString]] = None # content parameter
95
+ description: Optional[Union[str, TemplateString]] = None # description parameter
96
+ type_name: Optional[Union[str, TemplateString]] = Field(
97
+ default=None, alias="type"
98
+ ) # type parameter
99
+ searchable_texts: Optional[Any] = None # searchable_texts parameter
100
+ tags: Optional[Any] = None # tags parameter
101
+ created_from: Optional[Union[str, TemplateString]] = None # created_from parameter
102
+ created_by_entity_type: Optional[Union[str, TemplateString]] = (
103
+ None # created_by_entity_type parameter
104
+ )
105
+ integration_config_id: Optional[Union[str, TemplateString]] = (
106
+ None # integration_config_id parameter
107
+ )
108
+ dataset_id: Optional[Union[str, TemplateString]] = None # dataset_id parameter
109
+ thread_id: Optional[Union[str, TemplateString]] = None # thread_id parameter
110
+ is_organization_specific: Optional[Union[bool, TemplateString]] = (
111
+ None # is_organization_specific parameter
112
+ )
113
+ is_user_specific: Optional[Union[bool, TemplateString]] = (
114
+ None # is_user_specific parameter
115
+ )
116
+ estimated_stale_at: Optional[Union[str, TemplateString]] = (
117
+ None # estimated_stale_at parameter
118
+ )
119
+ stale_when_text: Optional[Union[str, TemplateString]] = (
120
+ None # stale_when_text parameter
121
+ )
122
+ extra: Optional[Any] = None # extra parameter
123
+
124
+
125
+ class DeleteParams(BaseActionParams):
126
+ """Soft delete a memory by marking it as deleted parameters"""
127
+
128
+ model_config = {"populate_by_name": True} # Allow both field names and aliases
129
+
130
+ name: str = "memory.delete" # Action type for roundtrip compatibility
131
+ id_value: Optional[Union[str, TemplateString]] = Field(
132
+ default=None, alias="id"
133
+ ) # id parameter
134
+
135
+
136
+ class MarkAsDedupedParams(BaseActionParams):
137
+ """Mark memories as deduplicated by another memory parameters"""
138
+
139
+ name: str = "memory.mark_as_deduped" # Action type for roundtrip compatibility
140
+ memory_ids: Optional[Any] = None # memory_ids parameter
141
+ deduped_by_id: Optional[Union[str, TemplateString]] = (
142
+ None # deduped_by_id parameter
143
+ )
144
+
145
+
146
+ class SearchResult(BaseModel):
147
+ """Search memories using semantic search with optional filters result type
148
+
149
+ Result schema for memory.search action.
150
+ """
151
+
152
+ memories: List[Memory]
153
+
154
+
155
+ class SearchFromQueriesResult(BaseModel):
156
+ """Search memories using multiple queries including integration-specific queries result type
157
+
158
+ Generic result schema for memory.search_from_queries action.
159
+ """
160
+
161
+ success: bool = True # Whether the action was successful
162
+
163
+ class Config:
164
+ extra = "allow" # Allow additional fields dynamically
165
+
166
+
167
+ class StoreResult(BaseModel):
168
+ """Store or update a memory with content, metadata, and scope settings result type
169
+
170
+ Result schema for memory.store action.
171
+ """
172
+
173
+ memory: Any
174
+
175
+
176
+ class UpdateResult(BaseModel):
177
+ """Update an existing memory with new content, metadata, or scope settings result type
178
+
179
+ Generic result schema for memory.update action.
180
+ """
181
+
182
+ success: bool = True # Whether the action was successful
183
+
184
+ class Config:
185
+ extra = "allow" # Allow additional fields dynamically
186
+
187
+
188
+ class DeleteResult(BaseModel):
189
+ """Soft delete a memory by marking it as deleted result type
190
+
191
+ Generic result schema for memory.delete action.
192
+ """
193
+
194
+ success: bool = True # Whether the action was successful
195
+
196
+ class Config:
197
+ extra = "allow" # Allow additional fields dynamically
198
+
199
+
200
+ class MarkAsDedupedResult(BaseModel):
201
+ """Mark memories as deduplicated by another memory result type
202
+
203
+ Generic result schema for memory.mark_as_deduped action.
204
+ """
205
+
206
+ success: bool = True # Whether the action was successful
207
+
208
+ class Config:
209
+ extra = "allow" # Allow additional fields dynamically
210
+
211
+
212
+ def search(
213
+ query: Optional[Union[str, TemplateString]] = None,
214
+ organization_scope: Optional[Union[str, TemplateString]] = None,
215
+ user_scope: Optional[Union[str, TemplateString]] = None,
216
+ thread_id: Optional[Union[str, TemplateString]] = None,
217
+ dataset_id: Optional[Union[str, TemplateString]] = None,
218
+ dataset_slug: Optional[Union[str, TemplateString]] = None,
219
+ integration_config_id: Optional[Union[str, TemplateString]] = None,
220
+ dataset_scope: Optional[Union[str, TemplateString]] = None,
221
+ integration_config_scope: Optional[Union[str, TemplateString]] = None,
222
+ thread_scope: Optional[Union[str, TemplateString]] = None,
223
+ approval_status: Optional[Union[str, TemplateString]] = None,
224
+ types: Optional[Any] = None,
225
+ limit: Optional[Union[int, TemplateString]] = None,
226
+ max_distance: Optional[Any] = None,
227
+ authorizers: Optional[Any] = None,
228
+ **params: Any,
229
+ ) -> SearchParams:
230
+ """Search memories using semantic search with optional filters
231
+
232
+ Args:
233
+ query: query parameter
234
+ organization_scope: organization_scope parameter
235
+ user_scope: user_scope parameter
236
+ thread_id: thread_id parameter
237
+ dataset_id: dataset_id parameter
238
+ dataset_slug: dataset_slug parameter
239
+ integration_config_id: integration_config_id parameter
240
+ dataset_scope: dataset_scope parameter
241
+ integration_config_scope: integration_config_scope parameter
242
+ thread_scope: thread_scope parameter
243
+ approval_status: approval_status parameter
244
+ types: types parameter
245
+ limit: limit parameter
246
+ max_distance: max_distance parameter
247
+ authorizers: authorizers parameter
248
+
249
+ Returns:
250
+ SearchParams: Type-safe parameter object
251
+ """
252
+ param_dict = {
253
+ "query": query,
254
+ "organization_scope": organization_scope,
255
+ "user_scope": user_scope,
256
+ "thread_id": thread_id,
257
+ "dataset_id": dataset_id,
258
+ "dataset_slug": dataset_slug,
259
+ "integration_config_id": integration_config_id,
260
+ "dataset_scope": dataset_scope,
261
+ "integration_config_scope": integration_config_scope,
262
+ "thread_scope": thread_scope,
263
+ "approval_status": approval_status,
264
+ "types": types,
265
+ "limit": limit,
266
+ "max_distance": max_distance,
267
+ "authorizers": authorizers,
268
+ }
269
+ # Remove None values for optional parameters
270
+ param_dict = {k: v for k, v in param_dict.items() if v is not None}
271
+ param_dict.update(params)
272
+ params_obj = SearchParams(**param_dict)
273
+ return params_obj
274
+
275
+
276
+ def search_from_queries(
277
+ queries: Optional[Any] = None,
278
+ integration_queries: Optional[Any] = None,
279
+ organization_scope: Optional[Union[str, TemplateString]] = None,
280
+ user_scope: Optional[Union[str, TemplateString]] = None,
281
+ user_id: Optional[Union[str, TemplateString]] = None,
282
+ thread_id: Optional[Union[str, TemplateString]] = None,
283
+ types: Optional[Any] = None,
284
+ limit: Optional[Union[int, TemplateString]] = None,
285
+ max_distance: Optional[Any] = None,
286
+ authorizers: Optional[Any] = None,
287
+ **params: Any,
288
+ ) -> SearchFromQueriesParams:
289
+ """Search memories using multiple queries including integration-specific queries
290
+
291
+ Args:
292
+ queries: queries parameter
293
+ integration_queries: integration_queries parameter
294
+ organization_scope: organization_scope parameter
295
+ user_scope: user_scope parameter
296
+ user_id: user_id parameter
297
+ thread_id: thread_id parameter
298
+ types: types parameter
299
+ limit: limit parameter
300
+ max_distance: max_distance parameter
301
+ authorizers: authorizers parameter
302
+
303
+ Returns:
304
+ SearchFromQueriesParams: Type-safe parameter object
305
+ """
306
+ param_dict = {
307
+ "queries": queries,
308
+ "integration_queries": integration_queries,
309
+ "organization_scope": organization_scope,
310
+ "user_scope": user_scope,
311
+ "user_id": user_id,
312
+ "thread_id": thread_id,
313
+ "types": types,
314
+ "limit": limit,
315
+ "max_distance": max_distance,
316
+ "authorizers": authorizers,
317
+ }
318
+ # Remove None values for optional parameters
319
+ param_dict = {k: v for k, v in param_dict.items() if v is not None}
320
+ param_dict.update(params)
321
+ params_obj = SearchFromQueriesParams(**param_dict)
322
+ return params_obj
323
+
324
+
325
+ def store(memory: Optional[Any] = None, **params: Any) -> StoreParams:
326
+ """Store or update a memory with content, metadata, and scope settings
327
+
328
+ Args:
329
+ memory: memory parameter
330
+
331
+ Returns:
332
+ StoreParams: Type-safe parameter object
333
+ """
334
+ param_dict = {
335
+ "memory": memory,
336
+ }
337
+ # Remove None values for optional parameters
338
+ param_dict = {k: v for k, v in param_dict.items() if v is not None}
339
+ param_dict.update(params)
340
+ params_obj = StoreParams(**param_dict)
341
+ return params_obj
342
+
343
+
344
+ def update(
345
+ id_value: Optional[Union[str, TemplateString]] = None,
346
+ content: Optional[Union[str, TemplateString]] = None,
347
+ description: Optional[Union[str, TemplateString]] = None,
348
+ type_name: Optional[Union[str, TemplateString]] = None,
349
+ searchable_texts: Optional[Any] = None,
350
+ tags: Optional[Any] = None,
351
+ created_from: Optional[Union[str, TemplateString]] = None,
352
+ created_by_entity_type: Optional[Union[str, TemplateString]] = None,
353
+ integration_config_id: Optional[Union[str, TemplateString]] = None,
354
+ dataset_id: Optional[Union[str, TemplateString]] = None,
355
+ thread_id: Optional[Union[str, TemplateString]] = None,
356
+ is_organization_specific: Optional[Union[bool, TemplateString]] = None,
357
+ is_user_specific: Optional[Union[bool, TemplateString]] = None,
358
+ estimated_stale_at: Optional[Union[str, TemplateString]] = None,
359
+ stale_when_text: Optional[Union[str, TemplateString]] = None,
360
+ extra: Optional[Any] = None,
361
+ **params: Any,
362
+ ) -> UpdateParams:
363
+ """Update an existing memory with new content, metadata, or scope settings
364
+
365
+ Args:
366
+ id_value: id parameter
367
+ content: content parameter
368
+ description: description parameter
369
+ type_name: type parameter
370
+ searchable_texts: searchable_texts parameter
371
+ tags: tags parameter
372
+ created_from: created_from parameter
373
+ created_by_entity_type: created_by_entity_type parameter
374
+ integration_config_id: integration_config_id parameter
375
+ dataset_id: dataset_id parameter
376
+ thread_id: thread_id parameter
377
+ is_organization_specific: is_organization_specific parameter
378
+ is_user_specific: is_user_specific parameter
379
+ estimated_stale_at: estimated_stale_at parameter
380
+ stale_when_text: stale_when_text parameter
381
+ extra: extra parameter
382
+
383
+ Returns:
384
+ UpdateParams: Type-safe parameter object
385
+ """
386
+ param_dict = {
387
+ "id": id_value,
388
+ "content": content,
389
+ "description": description,
390
+ "type": type_name,
391
+ "searchable_texts": searchable_texts,
392
+ "tags": tags,
393
+ "created_from": created_from,
394
+ "created_by_entity_type": created_by_entity_type,
395
+ "integration_config_id": integration_config_id,
396
+ "dataset_id": dataset_id,
397
+ "thread_id": thread_id,
398
+ "is_organization_specific": is_organization_specific,
399
+ "is_user_specific": is_user_specific,
400
+ "estimated_stale_at": estimated_stale_at,
401
+ "stale_when_text": stale_when_text,
402
+ "extra": extra,
403
+ }
404
+ # Remove None values for optional parameters
405
+ param_dict = {k: v for k, v in param_dict.items() if v is not None}
406
+ param_dict.update(params)
407
+ params_obj = UpdateParams(**param_dict)
408
+ return params_obj
409
+
410
+
411
+ def delete(
412
+ id_value: Optional[Union[str, TemplateString]] = None, **params: Any
413
+ ) -> DeleteParams:
414
+ """Soft delete a memory by marking it as deleted
415
+
416
+ Args:
417
+ id_value: id parameter
418
+
419
+ Returns:
420
+ DeleteParams: Type-safe parameter object
421
+ """
422
+ param_dict = {
423
+ "id": id_value,
424
+ }
425
+ # Remove None values for optional parameters
426
+ param_dict = {k: v for k, v in param_dict.items() if v is not None}
427
+ param_dict.update(params)
428
+ params_obj = DeleteParams(**param_dict)
429
+ return params_obj
430
+
431
+
432
+ def mark_as_deduped(
433
+ memory_ids: Optional[Any] = None,
434
+ deduped_by_id: Optional[Union[str, TemplateString]] = None,
435
+ **params: Any,
436
+ ) -> MarkAsDedupedParams:
437
+ """Mark memories as deduplicated by another memory
438
+
439
+ Args:
440
+ memory_ids: memory_ids parameter
441
+ deduped_by_id: deduped_by_id parameter
442
+
443
+ Returns:
444
+ MarkAsDedupedParams: Type-safe parameter object
445
+ """
446
+ param_dict = {
447
+ "memory_ids": memory_ids,
448
+ "deduped_by_id": deduped_by_id,
449
+ }
450
+ # Remove None values for optional parameters
451
+ param_dict = {k: v for k, v in param_dict.items() if v is not None}
452
+ param_dict.update(params)
453
+ params_obj = MarkAsDedupedParams(**param_dict)
454
+ return params_obj
455
+
456
+
457
+ # Associate parameter classes with their result types
458
+ SearchParams._result = SearchResult
459
+ SearchFromQueriesParams._result = SearchFromQueriesResult
460
+ StoreParams._result = StoreResult
461
+ UpdateParams._result = UpdateResult
462
+ DeleteParams._result = DeleteResult
463
+ MarkAsDedupedParams._result = MarkAsDedupedResult