erdo 0.1.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 erdo might be problematic. Click here for more details.
- erdo/__init__.py +35 -0
- erdo/_generated/__init__.py +18 -0
- erdo/_generated/actions/__init__.py +32 -0
- erdo/_generated/actions/analysis.py +67 -0
- erdo/_generated/actions/bot.py +124 -0
- erdo/_generated/actions/codeexec.py +172 -0
- erdo/_generated/actions/llm.py +104 -0
- erdo/_generated/actions/memory.py +252 -0
- erdo/_generated/actions/resource_definitions.py +194 -0
- erdo/_generated/actions/utils.py +397 -0
- erdo/_generated/actions/webparser.py +109 -0
- erdo/_generated/actions/websearch.py +75 -0
- erdo/_generated/condition/__init__.py +504 -0
- erdo/_generated/internal.py +51 -0
- erdo/_generated/internal_actions.py +79 -0
- erdo/_generated/parameters.py +17 -0
- erdo/_generated/secrets.py +17 -0
- erdo/_generated/template_functions.py +55 -0
- erdo/_generated/types.py +2514 -0
- erdo/actions/__init__.py +40 -0
- erdo/cli_entry.py +73 -0
- erdo/conditions/__init__.py +11 -0
- erdo/install_cli.py +140 -0
- erdo/integrations.py +131 -0
- erdo/py.typed +1 -0
- erdo/state.py +376 -0
- erdo/template.py +136 -0
- erdo/types.py +1142 -0
- erdo-0.1.4.dist-info/METADATA +344 -0
- erdo-0.1.4.dist-info/RECORD +33 -0
- erdo-0.1.4.dist-info/WHEEL +4 -0
- erdo-0.1.4.dist-info/entry_points.txt +2 -0
- erdo-0.1.4.dist-info/licenses/LICENSE +22 -0
erdo/_generated/types.py
ADDED
|
@@ -0,0 +1,2514 @@
|
|
|
1
|
+
# DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.
|
|
2
|
+
# Generated by: erdo gen-client
|
|
3
|
+
"""
|
|
4
|
+
Auto-generated type definitions from shared Go types.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass
|
|
10
|
+
from datetime import datetime
|
|
11
|
+
from enum import Enum
|
|
12
|
+
from typing import Any, Dict, List, Optional
|
|
13
|
+
from uuid import UUID
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# ParameterType (from ParameterType in Go)
|
|
17
|
+
class ParameterType(str, Enum):
|
|
18
|
+
"""Enum for ParameterType values"""
|
|
19
|
+
|
|
20
|
+
STRING = "string"
|
|
21
|
+
INTEGER = "integer"
|
|
22
|
+
FLOAT = "float"
|
|
23
|
+
BOOL = "bool"
|
|
24
|
+
JSON = "json"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# ParameterHydrationBehaviour (from ParameterHydrationBehaviour in Go)
|
|
28
|
+
class ParameterHydrationBehaviour(str, Enum):
|
|
29
|
+
"""Enum for ParameterHydrationBehaviour values"""
|
|
30
|
+
|
|
31
|
+
HYDRATE = "hydrate"
|
|
32
|
+
RAW = "raw"
|
|
33
|
+
NONE = "none"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# OutputVisibility (from OutputVisibility in Go)
|
|
37
|
+
class OutputVisibility(str, Enum):
|
|
38
|
+
"""Enum for OutputVisibility values"""
|
|
39
|
+
|
|
40
|
+
VISIBLE = "visible"
|
|
41
|
+
HIDDEN = "hidden"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# OutputContentType (from OutputContentType in Go)
|
|
45
|
+
class OutputContentType(str, Enum):
|
|
46
|
+
"""Enum for OutputContentType values"""
|
|
47
|
+
|
|
48
|
+
TEXT = "text"
|
|
49
|
+
JSON = "json"
|
|
50
|
+
HTML = "html"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# HandlerType (from HandlerType in Go)
|
|
54
|
+
class HandlerType(str, Enum):
|
|
55
|
+
"""Enum for HandlerType values"""
|
|
56
|
+
|
|
57
|
+
INTERMEDIATE = "intermediate"
|
|
58
|
+
FINAL = "final"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# ExecutionModeType (from ExecutionModeType in Go)
|
|
62
|
+
class ExecutionModeType(str, Enum):
|
|
63
|
+
"""Enum for ExecutionModeType values"""
|
|
64
|
+
|
|
65
|
+
ALL = "all"
|
|
66
|
+
ITERATE_OVER = "iterate_over"
|
|
67
|
+
ALL_BACKGROUND = "all_background"
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# Model (from Model in Go)
|
|
71
|
+
class LlmModel(str, Enum):
|
|
72
|
+
"""Enum for LlmModel values"""
|
|
73
|
+
|
|
74
|
+
CLAUDE_3_7_SONNET_20250219 = "claude-3-7-sonnet-20250219"
|
|
75
|
+
CLAUDE_SONNET_4_20250514 = "claude-sonnet-4-20250514"
|
|
76
|
+
CLAUDE_3_5_HAIKU_20241022 = "claude-3-5-haiku-20241022"
|
|
77
|
+
GPT_4O = "gpt-4o"
|
|
78
|
+
GPT_4O_MINI = "gpt-4o-mini"
|
|
79
|
+
GPT_4_1 = "gpt-4.1"
|
|
80
|
+
GPT_4_1_MINI = "gpt-4.1-mini"
|
|
81
|
+
GPT_4_1_NANO = "gpt-4.1-nano"
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
# OutputBehaviorType (from OutputBehaviorType in Go)
|
|
85
|
+
class OutputBehaviorType(str, Enum):
|
|
86
|
+
"""Enum for OutputBehaviorType values"""
|
|
87
|
+
|
|
88
|
+
STEP_ONLY = "step_only"
|
|
89
|
+
MERGE = "merge"
|
|
90
|
+
OVERWRITE = "overwrite"
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# CredentialSource (from CredentialSource in Go)
|
|
94
|
+
class CredentialSource(str, Enum):
|
|
95
|
+
"""Enum for CredentialSource values"""
|
|
96
|
+
|
|
97
|
+
INTEGRATION_CREDENTIALS = "integration_credentials"
|
|
98
|
+
CONFIG_PROVIDER_CREDENTIALS = "config_provider_credentials"
|
|
99
|
+
SEGMENT = "segment"
|
|
100
|
+
DATASET_PARAMETERS = "dataset_parameters"
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# SensitivityLevel (from SensitivityLevel in Go)
|
|
104
|
+
class SensitivityLevel(str, Enum):
|
|
105
|
+
"""Enum for SensitivityLevel values"""
|
|
106
|
+
|
|
107
|
+
NEVER_VIEWABLE = "never_viewable"
|
|
108
|
+
OWNER_VIEWABLE = "owner_viewable"
|
|
109
|
+
ADMIN_VIEWABLE = "admin_viewable"
|
|
110
|
+
EDIT_VIEWABLE = "edit_viewable"
|
|
111
|
+
ALL_VIEWABLE = "all_viewable"
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# JSONSchemaType (from JSONSchemaType in Go)
|
|
115
|
+
class JSONSchemaType(str, Enum):
|
|
116
|
+
"""Enum for JSONSchemaType values"""
|
|
117
|
+
|
|
118
|
+
STRING = "string"
|
|
119
|
+
NUMBER = "number"
|
|
120
|
+
BOOLEAN = "boolean"
|
|
121
|
+
OBJECT = "object"
|
|
122
|
+
ARRAY = "array"
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
# InvocationEventType (from InvocationEventType in Go)
|
|
126
|
+
class InvocationEventType(str, Enum):
|
|
127
|
+
"""Enum for InvocationEventType values"""
|
|
128
|
+
|
|
129
|
+
BOT_STARTED = "bot started"
|
|
130
|
+
MESSAGE_CREATED = "message created"
|
|
131
|
+
MESSAGE_FINISHED = "message finished"
|
|
132
|
+
MESSAGE_CONTENT_DELTA = "message content delta"
|
|
133
|
+
CREATE_MESSAGE_CONTENT = "create message content"
|
|
134
|
+
MESSAGE_CONTENT_RESULT = "message content result"
|
|
135
|
+
STEP_OUTPUT_CREATED = "step output created"
|
|
136
|
+
STEP_OUTPUT_FINISHED = "step output finished"
|
|
137
|
+
STEP_OUTPUT_CONTENT_DELTA = "step output content delta"
|
|
138
|
+
CREATE_STEP_OUTPUT_CONTENT = "create step output content"
|
|
139
|
+
STEP_OUTPUT_CONTENT_RESULT = "step output content result"
|
|
140
|
+
STEP_STARTED = "step started"
|
|
141
|
+
STEP_RESULT = "step result"
|
|
142
|
+
RESULT_HANDLER_STARTED = "result handler started"
|
|
143
|
+
REQUIRES_INFO = "requires info"
|
|
144
|
+
ERROR = "error"
|
|
145
|
+
STATUS = "status"
|
|
146
|
+
RESULT = "result"
|
|
147
|
+
DATASET_CREATED = "dataset created"
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# Status (from Status in Go)
|
|
151
|
+
class Status(str, Enum):
|
|
152
|
+
"""Enum for Status values"""
|
|
153
|
+
|
|
154
|
+
SKIPPED = "skipped"
|
|
155
|
+
SUCCESS = "success"
|
|
156
|
+
BREAK = "break"
|
|
157
|
+
ERROR = "error"
|
|
158
|
+
REQUIRES_INFO = "requires info"
|
|
159
|
+
GO_TO_STEP = "go to step"
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
# Error (from Error in Go)
|
|
163
|
+
class Error(str, Enum):
|
|
164
|
+
"""Enum for Error values"""
|
|
165
|
+
|
|
166
|
+
ACTION_NOT_FOUND = "action not found"
|
|
167
|
+
INTERNAL_ERROR = "internal error"
|
|
168
|
+
INFO_NEEDED = "info needed"
|
|
169
|
+
TERMINATED = "terminated"
|
|
170
|
+
BAD_REQUEST = "bad request"
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# DatasetType (from DatasetType in Go)
|
|
174
|
+
class DatasetType(str, Enum):
|
|
175
|
+
"""Enum for DatasetType values"""
|
|
176
|
+
|
|
177
|
+
FILE = "file"
|
|
178
|
+
DATABASE = "database"
|
|
179
|
+
INTEGRATION = "integration"
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# IntegrationType (from IntegrationType in Go)
|
|
183
|
+
class IntegrationType(str, Enum):
|
|
184
|
+
"""Enum for IntegrationType values"""
|
|
185
|
+
|
|
186
|
+
API = "api"
|
|
187
|
+
DATABASE = "database"
|
|
188
|
+
FILE = "file"
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# AuthType (from AuthType in Go)
|
|
192
|
+
class AuthType(str, Enum):
|
|
193
|
+
"""Enum for AuthType values"""
|
|
194
|
+
|
|
195
|
+
OAUTH2 = "oauth2"
|
|
196
|
+
API_KEY = "api_key"
|
|
197
|
+
DATABASE = "database"
|
|
198
|
+
BASIC_AUTH = "basic_auth"
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
# IntegrationStatus (from IntegrationStatus in Go)
|
|
202
|
+
class IntegrationStatus(str, Enum):
|
|
203
|
+
"""Enum for IntegrationStatus values"""
|
|
204
|
+
|
|
205
|
+
ACTIVE = "active"
|
|
206
|
+
INACTIVE = "inactive"
|
|
207
|
+
BETA = "beta"
|
|
208
|
+
COMING_SOON = "coming_soon"
|
|
209
|
+
ERROR = "error"
|
|
210
|
+
NEEDS_REAUTH = "needs_reauth"
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
# SegmentSelectionType (from SegmentSelectionType in Go)
|
|
214
|
+
class SegmentSelectionType(str, Enum):
|
|
215
|
+
"""Enum for SegmentSelectionType values"""
|
|
216
|
+
|
|
217
|
+
SINGLE = "single"
|
|
218
|
+
MULTIPLE = "multiple"
|
|
219
|
+
REQUIRED = "required"
|
|
220
|
+
OPTIONAL = "optional"
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
# ExpiryType (from ExpiryType in Go)
|
|
224
|
+
class ExpiryType(str, Enum):
|
|
225
|
+
"""Enum for ExpiryType values"""
|
|
226
|
+
|
|
227
|
+
OAUTH_DEFAULT = "oauth_default"
|
|
228
|
+
CONSTANT = "constant"
|
|
229
|
+
OAUTH_FIELD = "oauth_field"
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
# ResourceType (from ResourceType in Go)
|
|
233
|
+
class ResourceType(str, Enum):
|
|
234
|
+
"""Enum for ResourceType values"""
|
|
235
|
+
|
|
236
|
+
TABLE = "table"
|
|
237
|
+
ENDPOINT = "endpoint"
|
|
238
|
+
DOCUMENT = "document"
|
|
239
|
+
PARTIAL_DOCUMENT = "partial_document"
|
|
240
|
+
ENTITY = "entity"
|
|
241
|
+
SHEET = "sheet"
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
# ResourceState (from ResourceState in Go)
|
|
245
|
+
class ResourceState(str, Enum):
|
|
246
|
+
"""Enum for ResourceState values"""
|
|
247
|
+
|
|
248
|
+
ACTIVE = "active"
|
|
249
|
+
REMOVED = "removed"
|
|
250
|
+
DELETED = "deleted"
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# ResourceRelationshipType (from ResourceRelationshipType in Go)
|
|
254
|
+
class ResourceRelationshipType(str, Enum):
|
|
255
|
+
"""Enum for ResourceRelationshipType values"""
|
|
256
|
+
|
|
257
|
+
ACCEPTS = "accepts"
|
|
258
|
+
RETURNS = "returns"
|
|
259
|
+
LINKS_TO = "links_to"
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
# ResourceAttachType (from ResourceAttachType in Go)
|
|
263
|
+
class ResourceAttachType(str, Enum):
|
|
264
|
+
"""Enum for ResourceAttachType values"""
|
|
265
|
+
|
|
266
|
+
ALWAYS = "always"
|
|
267
|
+
SEARCHABLE = "searchable"
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
# Strongly-typed classes from Go structs
|
|
271
|
+
@dataclass
|
|
272
|
+
class Bot:
|
|
273
|
+
"""Bot matching Go backend structure."""
|
|
274
|
+
|
|
275
|
+
id: str
|
|
276
|
+
name: str
|
|
277
|
+
description: str
|
|
278
|
+
code: str
|
|
279
|
+
file_path: str
|
|
280
|
+
organization_id: str
|
|
281
|
+
visibility: str
|
|
282
|
+
source: str
|
|
283
|
+
persona: Optional[str] = None
|
|
284
|
+
running_message: Optional[str] = None
|
|
285
|
+
finished_message: Optional[str] = None
|
|
286
|
+
created_at: Optional[datetime] = None
|
|
287
|
+
updated_at: Optional[datetime] = None
|
|
288
|
+
|
|
289
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
290
|
+
"""Convert to dict format expected by backend."""
|
|
291
|
+
result = {}
|
|
292
|
+
result["id"] = self.id
|
|
293
|
+
result["name"] = self.name
|
|
294
|
+
result["description"] = self.description
|
|
295
|
+
result["code"] = self.code
|
|
296
|
+
result["file_path"] = self.file_path
|
|
297
|
+
if self.persona is not None:
|
|
298
|
+
result["persona"] = self.persona
|
|
299
|
+
if self.running_message is not None:
|
|
300
|
+
result["running_message"] = self.running_message
|
|
301
|
+
if self.finished_message is not None:
|
|
302
|
+
result["finished_message"] = self.finished_message
|
|
303
|
+
if self.created_at is not None:
|
|
304
|
+
result["created_at"] = self.created_at
|
|
305
|
+
if self.updated_at is not None:
|
|
306
|
+
result["updated_at"] = self.updated_at
|
|
307
|
+
result["organization_id"] = self.organization_id
|
|
308
|
+
result["visibility"] = self.visibility
|
|
309
|
+
result["source"] = self.source
|
|
310
|
+
return result
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
@dataclass
|
|
314
|
+
class ParameterDefinition:
|
|
315
|
+
"""ParameterDefinition matching Go backend structure."""
|
|
316
|
+
|
|
317
|
+
name: str
|
|
318
|
+
key: str
|
|
319
|
+
type: Any
|
|
320
|
+
is_required: bool
|
|
321
|
+
id: Optional[UUID] = None
|
|
322
|
+
bot_id: Optional[UUID] = None
|
|
323
|
+
description: Optional[str] = None
|
|
324
|
+
created_at: Optional[datetime] = None
|
|
325
|
+
updated_at: Optional[datetime] = None
|
|
326
|
+
value_sources: List["ParameterValueSource"] = None
|
|
327
|
+
interpreters: List["ParameterInterpreter"] = None
|
|
328
|
+
|
|
329
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
330
|
+
"""Convert to dict format expected by backend."""
|
|
331
|
+
result = {}
|
|
332
|
+
if self.id is not None:
|
|
333
|
+
result["id"] = self.id
|
|
334
|
+
if self.bot_id is not None:
|
|
335
|
+
result["bot_id"] = self.bot_id
|
|
336
|
+
result["name"] = self.name
|
|
337
|
+
result["key"] = self.key
|
|
338
|
+
if self.description is not None:
|
|
339
|
+
result["description"] = self.description
|
|
340
|
+
result["type"] = self.type
|
|
341
|
+
result["is_required"] = self.is_required
|
|
342
|
+
if self.created_at is not None:
|
|
343
|
+
result["created_at"] = self.created_at
|
|
344
|
+
if self.updated_at is not None:
|
|
345
|
+
result["updated_at"] = self.updated_at
|
|
346
|
+
if self.value_sources is not None:
|
|
347
|
+
result["value_sources"] = self.value_sources
|
|
348
|
+
if self.interpreters is not None:
|
|
349
|
+
result["interpreters"] = self.interpreters
|
|
350
|
+
return result
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
@dataclass
|
|
354
|
+
class ParameterValueSource:
|
|
355
|
+
"""ParameterValueSource matching Go backend structure."""
|
|
356
|
+
|
|
357
|
+
type: Any
|
|
358
|
+
parameters: Any
|
|
359
|
+
id: Optional[UUID] = None
|
|
360
|
+
parameter_definition_id: Optional[UUID] = None
|
|
361
|
+
created_at: Optional[datetime] = None
|
|
362
|
+
updated_at: Optional[datetime] = None
|
|
363
|
+
on_populate: List["ParameterValueSourceHandler"] = None
|
|
364
|
+
|
|
365
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
366
|
+
"""Convert to dict format expected by backend."""
|
|
367
|
+
result = {}
|
|
368
|
+
if self.id is not None:
|
|
369
|
+
result["id"] = self.id
|
|
370
|
+
if self.parameter_definition_id is not None:
|
|
371
|
+
result["parameter_definition_id"] = self.parameter_definition_id
|
|
372
|
+
result["type"] = self.type
|
|
373
|
+
result["parameters"] = self.parameters
|
|
374
|
+
if self.created_at is not None:
|
|
375
|
+
result["created_at"] = self.created_at
|
|
376
|
+
if self.updated_at is not None:
|
|
377
|
+
result["updated_at"] = self.updated_at
|
|
378
|
+
if self.on_populate is not None:
|
|
379
|
+
result["on_populate"] = self.on_populate
|
|
380
|
+
return result
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
@dataclass
|
|
384
|
+
class ParameterValueSourceHandler:
|
|
385
|
+
"""ParameterValueSourceHandler matching Go backend structure."""
|
|
386
|
+
|
|
387
|
+
action_type: str
|
|
388
|
+
parameters: Any
|
|
389
|
+
execution_mode: str
|
|
390
|
+
id: Optional[UUID] = None
|
|
391
|
+
parameter_value_source_id: Optional[UUID] = None
|
|
392
|
+
created_at: Optional[datetime] = None
|
|
393
|
+
updated_at: Optional[datetime] = None
|
|
394
|
+
|
|
395
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
396
|
+
"""Convert to dict format expected by backend."""
|
|
397
|
+
result = {}
|
|
398
|
+
if self.id is not None:
|
|
399
|
+
result["id"] = self.id
|
|
400
|
+
if self.parameter_value_source_id is not None:
|
|
401
|
+
result["parameter_value_source_id"] = self.parameter_value_source_id
|
|
402
|
+
result["action_type"] = self.action_type
|
|
403
|
+
result["parameters"] = self.parameters
|
|
404
|
+
result["execution_mode"] = self.execution_mode
|
|
405
|
+
if self.created_at is not None:
|
|
406
|
+
result["created_at"] = self.created_at
|
|
407
|
+
if self.updated_at is not None:
|
|
408
|
+
result["updated_at"] = self.updated_at
|
|
409
|
+
return result
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
@dataclass
|
|
413
|
+
class ParameterInterpreter:
|
|
414
|
+
"""ParameterInterpreter matching Go backend structure."""
|
|
415
|
+
|
|
416
|
+
action_type: str
|
|
417
|
+
parameters: Any
|
|
418
|
+
interpreter_order: int
|
|
419
|
+
id: Optional[UUID] = None
|
|
420
|
+
parameter_definition_id: Optional[UUID] = None
|
|
421
|
+
created_at: Optional[datetime] = None
|
|
422
|
+
updated_at: Optional[datetime] = None
|
|
423
|
+
|
|
424
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
425
|
+
"""Convert to dict format expected by backend."""
|
|
426
|
+
result = {}
|
|
427
|
+
if self.id is not None:
|
|
428
|
+
result["id"] = self.id
|
|
429
|
+
if self.parameter_definition_id is not None:
|
|
430
|
+
result["parameter_definition_id"] = self.parameter_definition_id
|
|
431
|
+
result["action_type"] = self.action_type
|
|
432
|
+
result["parameters"] = self.parameters
|
|
433
|
+
result["interpreter_order"] = self.interpreter_order
|
|
434
|
+
if self.created_at is not None:
|
|
435
|
+
result["created_at"] = self.created_at
|
|
436
|
+
if self.updated_at is not None:
|
|
437
|
+
result["updated_at"] = self.updated_at
|
|
438
|
+
return result
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
@dataclass
|
|
442
|
+
class AgentDiscovery:
|
|
443
|
+
"""AgentDiscovery matching Go backend structure."""
|
|
444
|
+
|
|
445
|
+
bot: "Bot"
|
|
446
|
+
parameter_definitions: List["ParameterDefinition"]
|
|
447
|
+
steps: List["StepWithHandlers"]
|
|
448
|
+
file_path: str
|
|
449
|
+
source_code: str
|
|
450
|
+
|
|
451
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
452
|
+
"""Convert to dict format expected by backend."""
|
|
453
|
+
result = {}
|
|
454
|
+
result["bot"] = self.bot
|
|
455
|
+
result["parameter_definitions"] = self.parameter_definitions
|
|
456
|
+
result["steps"] = self.steps
|
|
457
|
+
result["file_path"] = self.file_path
|
|
458
|
+
result["source_code"] = self.source_code
|
|
459
|
+
return result
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
@dataclass
|
|
463
|
+
class ExecutionModeConfig:
|
|
464
|
+
"""ExecutionMode matching Go backend structure."""
|
|
465
|
+
|
|
466
|
+
mode: str
|
|
467
|
+
data: Any
|
|
468
|
+
if_condition: Optional["ConditionDefinition"] = None
|
|
469
|
+
|
|
470
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
471
|
+
"""Convert to dict format expected by backend."""
|
|
472
|
+
result = {}
|
|
473
|
+
result["mode"] = self.mode
|
|
474
|
+
result["data"] = self.data
|
|
475
|
+
if self.if_condition is not None:
|
|
476
|
+
result["if_condition"] = self.if_condition
|
|
477
|
+
return result
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
@dataclass
|
|
481
|
+
class UpsertBotRequest:
|
|
482
|
+
"""UpsertBotRequest matching Go backend structure."""
|
|
483
|
+
|
|
484
|
+
bot: "Bot"
|
|
485
|
+
steps: List["APIStepWithHandlers"]
|
|
486
|
+
source: str
|
|
487
|
+
parameter_definitions: List["APIParameterDefinition"] = None
|
|
488
|
+
|
|
489
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
490
|
+
"""Convert to dict format expected by backend."""
|
|
491
|
+
result = {}
|
|
492
|
+
result["bot"] = self.bot
|
|
493
|
+
result["steps"] = self.steps
|
|
494
|
+
result["source"] = self.source
|
|
495
|
+
if self.parameter_definitions is not None:
|
|
496
|
+
result["parameter_definitions"] = self.parameter_definitions
|
|
497
|
+
return result
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
@dataclass
|
|
501
|
+
class BotsResponse:
|
|
502
|
+
"""BotsResponse matching Go backend structure."""
|
|
503
|
+
|
|
504
|
+
bots: List["Bot"]
|
|
505
|
+
|
|
506
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
507
|
+
"""Convert to dict format expected by backend."""
|
|
508
|
+
result = {}
|
|
509
|
+
result["bots"] = self.bots
|
|
510
|
+
return result
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
@dataclass
|
|
514
|
+
class StepsResponse:
|
|
515
|
+
"""StepsResponse matching Go backend structure."""
|
|
516
|
+
|
|
517
|
+
steps: List["APIStep"]
|
|
518
|
+
|
|
519
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
520
|
+
"""Convert to dict format expected by backend."""
|
|
521
|
+
result = {}
|
|
522
|
+
result["steps"] = self.steps
|
|
523
|
+
return result
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
@dataclass
|
|
527
|
+
class ServiceDefinition:
|
|
528
|
+
"""ServiceDefinition matching Go backend structure."""
|
|
529
|
+
|
|
530
|
+
name: str
|
|
531
|
+
description: str
|
|
532
|
+
actions: List["ActionDefinition"]
|
|
533
|
+
|
|
534
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
535
|
+
"""Convert to dict format expected by backend."""
|
|
536
|
+
result = {}
|
|
537
|
+
result["name"] = self.name
|
|
538
|
+
result["description"] = self.description
|
|
539
|
+
result["actions"] = self.actions
|
|
540
|
+
return result
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
@dataclass
|
|
544
|
+
class ActionDefinition:
|
|
545
|
+
"""ActionDefinition matching Go backend structure."""
|
|
546
|
+
|
|
547
|
+
name: str
|
|
548
|
+
description: str
|
|
549
|
+
parameters: List["ParameterDefinition"]
|
|
550
|
+
result_schema: Optional["ResultSchema"] = None
|
|
551
|
+
|
|
552
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
553
|
+
"""Convert to dict format expected by backend."""
|
|
554
|
+
result = {}
|
|
555
|
+
result["name"] = self.name
|
|
556
|
+
result["description"] = self.description
|
|
557
|
+
result["parameters"] = self.parameters
|
|
558
|
+
if self.result_schema is not None:
|
|
559
|
+
result["result_schema"] = self.result_schema
|
|
560
|
+
return result
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
@dataclass
|
|
564
|
+
class ResultSchema:
|
|
565
|
+
"""ResultSchema matching Go backend structure."""
|
|
566
|
+
|
|
567
|
+
properties: Any
|
|
568
|
+
description: str = None
|
|
569
|
+
required_fields: List[str] = None
|
|
570
|
+
optional_fields: List[str] = None
|
|
571
|
+
examples: List[Any] = None
|
|
572
|
+
|
|
573
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
574
|
+
"""Convert to dict format expected by backend."""
|
|
575
|
+
result = {}
|
|
576
|
+
if self.description is not None:
|
|
577
|
+
result["description"] = self.description
|
|
578
|
+
if self.required_fields is not None:
|
|
579
|
+
result["required_fields"] = self.required_fields
|
|
580
|
+
if self.optional_fields is not None:
|
|
581
|
+
result["optional_fields"] = self.optional_fields
|
|
582
|
+
result["properties"] = self.properties
|
|
583
|
+
if self.examples is not None:
|
|
584
|
+
result["examples"] = self.examples
|
|
585
|
+
return result
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
@dataclass
|
|
589
|
+
class PropertySchema:
|
|
590
|
+
"""PropertySchema matching Go backend structure."""
|
|
591
|
+
|
|
592
|
+
type: Any
|
|
593
|
+
description: str = None
|
|
594
|
+
items: Optional["PropertySchema"] = None
|
|
595
|
+
properties: Any = None
|
|
596
|
+
example: Any = None
|
|
597
|
+
enum: List[str] = None
|
|
598
|
+
|
|
599
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
600
|
+
"""Convert to dict format expected by backend."""
|
|
601
|
+
result = {}
|
|
602
|
+
result["type"] = self.type
|
|
603
|
+
if self.description is not None:
|
|
604
|
+
result["description"] = self.description
|
|
605
|
+
if self.items is not None:
|
|
606
|
+
result["items"] = self.items
|
|
607
|
+
if self.properties is not None:
|
|
608
|
+
result["properties"] = self.properties
|
|
609
|
+
if self.example is not None:
|
|
610
|
+
result["example"] = self.example
|
|
611
|
+
if self.enum is not None:
|
|
612
|
+
result["enum"] = self.enum
|
|
613
|
+
return result
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
@dataclass
|
|
617
|
+
class IntegrationSchema:
|
|
618
|
+
"""IntegrationSchema matching Go backend structure."""
|
|
619
|
+
|
|
620
|
+
key: str
|
|
621
|
+
name: str
|
|
622
|
+
description: str
|
|
623
|
+
type: str
|
|
624
|
+
auth_types: List[str]
|
|
625
|
+
credential_schema: Any
|
|
626
|
+
available_scopes: List[str]
|
|
627
|
+
documentation_url: str
|
|
628
|
+
codegen_details: Optional[CodegenDetails] = None
|
|
629
|
+
analysis_details: Optional[AnalysisDetails] = None
|
|
630
|
+
|
|
631
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
632
|
+
"""Convert to dict format expected by backend."""
|
|
633
|
+
result = {}
|
|
634
|
+
result["key"] = self.key
|
|
635
|
+
result["name"] = self.name
|
|
636
|
+
result["description"] = self.description
|
|
637
|
+
result["type"] = self.type
|
|
638
|
+
result["auth_types"] = self.auth_types
|
|
639
|
+
result["credential_schema"] = self.credential_schema
|
|
640
|
+
result["available_scopes"] = self.available_scopes
|
|
641
|
+
result["documentation_url"] = self.documentation_url
|
|
642
|
+
if self.codegen_details is not None:
|
|
643
|
+
result["codegen_details"] = self.codegen_details
|
|
644
|
+
if self.analysis_details is not None:
|
|
645
|
+
result["analysis_details"] = self.analysis_details
|
|
646
|
+
return result
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
@dataclass
|
|
650
|
+
class CodegenDetails:
|
|
651
|
+
"""CodegenDetails matching Go backend structure."""
|
|
652
|
+
|
|
653
|
+
code: str
|
|
654
|
+
imports: List[str]
|
|
655
|
+
hint: str = None
|
|
656
|
+
|
|
657
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
658
|
+
"""Convert to dict format expected by backend."""
|
|
659
|
+
result = {}
|
|
660
|
+
result["code"] = self.code
|
|
661
|
+
result["imports"] = self.imports
|
|
662
|
+
if self.hint is not None:
|
|
663
|
+
result["hint"] = self.hint
|
|
664
|
+
return result
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
@dataclass
|
|
668
|
+
class AnalysisDetails:
|
|
669
|
+
"""AnalysisDetails matching Go backend structure."""
|
|
670
|
+
|
|
671
|
+
imports: List[str]
|
|
672
|
+
code: str
|
|
673
|
+
|
|
674
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
675
|
+
"""Convert to dict format expected by backend."""
|
|
676
|
+
result = {}
|
|
677
|
+
result["imports"] = self.imports
|
|
678
|
+
result["code"] = self.code
|
|
679
|
+
return result
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
@dataclass
|
|
683
|
+
class CredentialSchema:
|
|
684
|
+
"""CredentialSchema matching Go backend structure."""
|
|
685
|
+
|
|
686
|
+
type: str
|
|
687
|
+
description: str
|
|
688
|
+
required: bool
|
|
689
|
+
source: Any
|
|
690
|
+
sensitivity: Any = None
|
|
691
|
+
jq: str = None
|
|
692
|
+
header: str = None
|
|
693
|
+
|
|
694
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
695
|
+
"""Convert to dict format expected by backend."""
|
|
696
|
+
result = {}
|
|
697
|
+
result["type"] = self.type
|
|
698
|
+
result["description"] = self.description
|
|
699
|
+
result["required"] = self.required
|
|
700
|
+
result["source"] = self.source
|
|
701
|
+
if self.sensitivity is not None:
|
|
702
|
+
result["sensitivity"] = self.sensitivity
|
|
703
|
+
if self.jq is not None:
|
|
704
|
+
result["jq"] = self.jq
|
|
705
|
+
if self.header is not None:
|
|
706
|
+
result["header"] = self.header
|
|
707
|
+
return result
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
@dataclass
|
|
711
|
+
class ExportActionsResponse:
|
|
712
|
+
"""ExportActionsResponse matching Go backend structure."""
|
|
713
|
+
|
|
714
|
+
services: Any
|
|
715
|
+
integrations: Any
|
|
716
|
+
|
|
717
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
718
|
+
"""Convert to dict format expected by backend."""
|
|
719
|
+
result = {}
|
|
720
|
+
result["services"] = self.services
|
|
721
|
+
result["integrations"] = self.integrations
|
|
722
|
+
return result
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
@dataclass
|
|
726
|
+
class ConditionDefinition:
|
|
727
|
+
"""ConditionDefinition matching Go backend structure."""
|
|
728
|
+
|
|
729
|
+
type: str
|
|
730
|
+
conditions: List["ConditionDefinition"] = None
|
|
731
|
+
leaf: Any = None
|
|
732
|
+
|
|
733
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
734
|
+
"""Convert to dict format expected by backend."""
|
|
735
|
+
result = {}
|
|
736
|
+
result["type"] = self.type
|
|
737
|
+
if self.conditions is not None:
|
|
738
|
+
result["conditions"] = self.conditions
|
|
739
|
+
if self.leaf is not None:
|
|
740
|
+
result["leaf"] = self.leaf
|
|
741
|
+
return result
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
@dataclass
|
|
745
|
+
class TempCondition:
|
|
746
|
+
"""TempCondition matching Go backend structure."""
|
|
747
|
+
|
|
748
|
+
type: str
|
|
749
|
+
conditions: Any = None
|
|
750
|
+
leaf: Any = None
|
|
751
|
+
|
|
752
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
753
|
+
"""Convert to dict format expected by backend."""
|
|
754
|
+
result = {}
|
|
755
|
+
result["type"] = self.type
|
|
756
|
+
if self.conditions is not None:
|
|
757
|
+
result["conditions"] = self.conditions
|
|
758
|
+
if self.leaf is not None:
|
|
759
|
+
result["leaf"] = self.leaf
|
|
760
|
+
return result
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
@dataclass
|
|
764
|
+
class StepWithHandlers:
|
|
765
|
+
"""StepWithHandlers matching Go backend structure."""
|
|
766
|
+
|
|
767
|
+
step: "Step"
|
|
768
|
+
result_handlers: List["ResultHandler"]
|
|
769
|
+
|
|
770
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
771
|
+
"""Convert to dict format expected by backend."""
|
|
772
|
+
result = {}
|
|
773
|
+
result["step"] = self.step
|
|
774
|
+
result["result_handlers"] = self.result_handlers
|
|
775
|
+
return result
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
@dataclass
|
|
779
|
+
class ResultHandler:
|
|
780
|
+
"""ResultHandler matching Go backend structure."""
|
|
781
|
+
|
|
782
|
+
type: str
|
|
783
|
+
if_conditions: "ConditionDefinition"
|
|
784
|
+
result_handler_order: int
|
|
785
|
+
output_content_type: str
|
|
786
|
+
steps: List["StepWithHandlers"]
|
|
787
|
+
history_content_type: Optional[str] = None
|
|
788
|
+
ui_content_type: Optional[str] = None
|
|
789
|
+
|
|
790
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
791
|
+
"""Convert to dict format expected by backend."""
|
|
792
|
+
result = {}
|
|
793
|
+
result["type"] = self.type
|
|
794
|
+
result["if_conditions"] = self.if_conditions
|
|
795
|
+
result["result_handler_order"] = self.result_handler_order
|
|
796
|
+
result["output_content_type"] = self.output_content_type
|
|
797
|
+
if self.history_content_type is not None:
|
|
798
|
+
result["history_content_type"] = self.history_content_type
|
|
799
|
+
if self.ui_content_type is not None:
|
|
800
|
+
result["ui_content_type"] = self.ui_content_type
|
|
801
|
+
result["steps"] = self.steps
|
|
802
|
+
return result
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
@dataclass
|
|
806
|
+
class JSONSchemaProperty:
|
|
807
|
+
"""JSONSchemaProperty matching Go backend structure."""
|
|
808
|
+
|
|
809
|
+
type: Any
|
|
810
|
+
description: str = None
|
|
811
|
+
items: Optional["JSONSchemaProperty"] = None
|
|
812
|
+
enum: List[str] = None
|
|
813
|
+
|
|
814
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
815
|
+
"""Convert to dict format expected by backend."""
|
|
816
|
+
result = {}
|
|
817
|
+
result["type"] = self.type
|
|
818
|
+
if self.description is not None:
|
|
819
|
+
result["description"] = self.description
|
|
820
|
+
if self.items is not None:
|
|
821
|
+
result["items"] = self.items
|
|
822
|
+
if self.enum is not None:
|
|
823
|
+
result["enum"] = self.enum
|
|
824
|
+
return result
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
@dataclass
|
|
828
|
+
class JSONSchema:
|
|
829
|
+
"""JSONSchema matching Go backend structure."""
|
|
830
|
+
|
|
831
|
+
type: Any
|
|
832
|
+
properties: Any = None
|
|
833
|
+
required: List[str] = None
|
|
834
|
+
items: Optional["JSONSchemaProperty"] = None
|
|
835
|
+
|
|
836
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
837
|
+
"""Convert to dict format expected by backend."""
|
|
838
|
+
result = {}
|
|
839
|
+
result["type"] = self.type
|
|
840
|
+
if self.properties is not None:
|
|
841
|
+
result["properties"] = self.properties
|
|
842
|
+
if self.required is not None:
|
|
843
|
+
result["required"] = self.required
|
|
844
|
+
if self.items is not None:
|
|
845
|
+
result["items"] = self.items
|
|
846
|
+
return result
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
@dataclass
|
|
850
|
+
class Tool:
|
|
851
|
+
"""Tool matching Go backend structure."""
|
|
852
|
+
|
|
853
|
+
name: str
|
|
854
|
+
description: str
|
|
855
|
+
input_schema: "JSONSchema"
|
|
856
|
+
action_type: str
|
|
857
|
+
parameters: Any
|
|
858
|
+
bot_output_visibility: str = None
|
|
859
|
+
history_content_type: str = None
|
|
860
|
+
ui_content_type: str = None
|
|
861
|
+
as_root: bool = None
|
|
862
|
+
|
|
863
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
864
|
+
"""Convert to dict format expected by backend."""
|
|
865
|
+
result = {}
|
|
866
|
+
result["name"] = self.name
|
|
867
|
+
result["description"] = self.description
|
|
868
|
+
result["input_schema"] = self.input_schema
|
|
869
|
+
result["action_type"] = self.action_type
|
|
870
|
+
result["parameters"] = self.parameters
|
|
871
|
+
if self.bot_output_visibility is not None:
|
|
872
|
+
result["bot_output_visibility"] = self.bot_output_visibility
|
|
873
|
+
if self.history_content_type is not None:
|
|
874
|
+
result["history_content_type"] = self.history_content_type
|
|
875
|
+
if self.ui_content_type is not None:
|
|
876
|
+
result["ui_content_type"] = self.ui_content_type
|
|
877
|
+
if self.as_root is not None:
|
|
878
|
+
result["as_root"] = self.as_root
|
|
879
|
+
return result
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
@dataclass
|
|
883
|
+
class Message:
|
|
884
|
+
"""Message matching Go backend structure."""
|
|
885
|
+
|
|
886
|
+
id: str
|
|
887
|
+
role: str
|
|
888
|
+
content: str
|
|
889
|
+
created_at: Optional[datetime] = None
|
|
890
|
+
|
|
891
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
892
|
+
"""Convert to dict format expected by backend."""
|
|
893
|
+
result = {}
|
|
894
|
+
result["id"] = self.id
|
|
895
|
+
result["role"] = self.role
|
|
896
|
+
result["content"] = self.content
|
|
897
|
+
if self.created_at is not None:
|
|
898
|
+
result["created_at"] = self.created_at
|
|
899
|
+
return result
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
@dataclass
|
|
903
|
+
class SystemParameters:
|
|
904
|
+
"""SystemParameters matching Go backend structure."""
|
|
905
|
+
|
|
906
|
+
current_date: str
|
|
907
|
+
messages: List["Message"]
|
|
908
|
+
session_messages: List["Message"]
|
|
909
|
+
current_message: str
|
|
910
|
+
thread_id: UUID
|
|
911
|
+
organization_id: str
|
|
912
|
+
invocation_id: UUID
|
|
913
|
+
|
|
914
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
915
|
+
"""Convert to dict format expected by backend."""
|
|
916
|
+
result = {}
|
|
917
|
+
result["current_date"] = self.current_date
|
|
918
|
+
result["messages"] = self.messages
|
|
919
|
+
result["session_messages"] = self.session_messages
|
|
920
|
+
result["current_message"] = self.current_message
|
|
921
|
+
result["thread_id"] = self.thread_id
|
|
922
|
+
result["organization_id"] = self.organization_id
|
|
923
|
+
result["invocation_id"] = self.invocation_id
|
|
924
|
+
return result
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
@dataclass
|
|
928
|
+
class Result:
|
|
929
|
+
"""Result matching Go backend structure."""
|
|
930
|
+
|
|
931
|
+
status: Any
|
|
932
|
+
parameters: Optional[Any] = None
|
|
933
|
+
output: Optional[Any] = None
|
|
934
|
+
message: Optional[str] = None
|
|
935
|
+
error: Optional[Any] = None
|
|
936
|
+
|
|
937
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
938
|
+
"""Convert to dict format expected by backend."""
|
|
939
|
+
result = {}
|
|
940
|
+
result["status"] = self.status
|
|
941
|
+
if self.parameters is not None:
|
|
942
|
+
result["parameters"] = self.parameters
|
|
943
|
+
if self.output is not None:
|
|
944
|
+
result["output"] = self.output
|
|
945
|
+
if self.message is not None:
|
|
946
|
+
result["message"] = self.message
|
|
947
|
+
if self.error is not None:
|
|
948
|
+
result["error"] = self.error
|
|
949
|
+
return result
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
@dataclass
|
|
953
|
+
class APIStep:
|
|
954
|
+
"""APIStep matching Go backend structure."""
|
|
955
|
+
|
|
956
|
+
id: str
|
|
957
|
+
bot_id: str
|
|
958
|
+
action_type: str
|
|
959
|
+
parameters: Any
|
|
960
|
+
step_order: int
|
|
961
|
+
output_content_type: str
|
|
962
|
+
user_output_visibility: str
|
|
963
|
+
bot_output_visibility: str
|
|
964
|
+
execution_mode: "APIExecutionMode"
|
|
965
|
+
output_behaviour: Any
|
|
966
|
+
output_channels: List[str]
|
|
967
|
+
parameter_hydration_behaviour: Any
|
|
968
|
+
depends_on: Optional[List[str]] = None
|
|
969
|
+
key: Optional[str] = None
|
|
970
|
+
running_message: Optional[str] = None
|
|
971
|
+
finished_message: Optional[str] = None
|
|
972
|
+
history_content_type: Optional[str] = None
|
|
973
|
+
ui_content_type: Optional[str] = None
|
|
974
|
+
result_handler_id: Optional[str] = None
|
|
975
|
+
created_at: Optional[datetime] = None
|
|
976
|
+
updated_at: Optional[datetime] = None
|
|
977
|
+
|
|
978
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
979
|
+
"""Convert to dict format expected by backend."""
|
|
980
|
+
result = {}
|
|
981
|
+
result["id"] = self.id
|
|
982
|
+
result["bot_id"] = self.bot_id
|
|
983
|
+
result["action_type"] = self.action_type
|
|
984
|
+
result["parameters"] = self.parameters
|
|
985
|
+
if self.depends_on is not None:
|
|
986
|
+
result["depends_on"] = self.depends_on
|
|
987
|
+
if self.key is not None:
|
|
988
|
+
result["key"] = self.key
|
|
989
|
+
result["step_order"] = self.step_order
|
|
990
|
+
result["output_content_type"] = self.output_content_type
|
|
991
|
+
result["user_output_visibility"] = self.user_output_visibility
|
|
992
|
+
result["bot_output_visibility"] = self.bot_output_visibility
|
|
993
|
+
result["execution_mode"] = self.execution_mode
|
|
994
|
+
result["output_behaviour"] = self.output_behaviour
|
|
995
|
+
result["output_channels"] = self.output_channels
|
|
996
|
+
if self.running_message is not None:
|
|
997
|
+
result["running_message"] = self.running_message
|
|
998
|
+
if self.finished_message is not None:
|
|
999
|
+
result["finished_message"] = self.finished_message
|
|
1000
|
+
if self.history_content_type is not None:
|
|
1001
|
+
result["history_content_type"] = self.history_content_type
|
|
1002
|
+
if self.ui_content_type is not None:
|
|
1003
|
+
result["ui_content_type"] = self.ui_content_type
|
|
1004
|
+
result["parameter_hydration_behaviour"] = self.parameter_hydration_behaviour
|
|
1005
|
+
if self.result_handler_id is not None:
|
|
1006
|
+
result["result_handler_id"] = self.result_handler_id
|
|
1007
|
+
if self.created_at is not None:
|
|
1008
|
+
result["created_at"] = self.created_at
|
|
1009
|
+
if self.updated_at is not None:
|
|
1010
|
+
result["updated_at"] = self.updated_at
|
|
1011
|
+
return result
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
@dataclass
|
|
1015
|
+
class APIParameterValueSource:
|
|
1016
|
+
"""APIParameterValueSource matching Go backend structure."""
|
|
1017
|
+
|
|
1018
|
+
type: Any
|
|
1019
|
+
parameters: Any
|
|
1020
|
+
id: Optional[UUID] = None
|
|
1021
|
+
parameter_definition_id: Optional[UUID] = None
|
|
1022
|
+
created_at: Optional[datetime] = None
|
|
1023
|
+
updated_at: Optional[datetime] = None
|
|
1024
|
+
on_populate: List["APIParameterValueSourceHandler"] = None
|
|
1025
|
+
|
|
1026
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1027
|
+
"""Convert to dict format expected by backend."""
|
|
1028
|
+
result = {}
|
|
1029
|
+
if self.id is not None:
|
|
1030
|
+
result["id"] = self.id
|
|
1031
|
+
if self.parameter_definition_id is not None:
|
|
1032
|
+
result["parameter_definition_id"] = self.parameter_definition_id
|
|
1033
|
+
result["type"] = self.type
|
|
1034
|
+
result["parameters"] = self.parameters
|
|
1035
|
+
if self.created_at is not None:
|
|
1036
|
+
result["created_at"] = self.created_at
|
|
1037
|
+
if self.updated_at is not None:
|
|
1038
|
+
result["updated_at"] = self.updated_at
|
|
1039
|
+
if self.on_populate is not None:
|
|
1040
|
+
result["on_populate"] = self.on_populate
|
|
1041
|
+
return result
|
|
1042
|
+
|
|
1043
|
+
|
|
1044
|
+
@dataclass
|
|
1045
|
+
class APIParameterValueSourceHandler:
|
|
1046
|
+
"""APIParameterValueSourceHandler matching Go backend structure."""
|
|
1047
|
+
|
|
1048
|
+
action_type: str
|
|
1049
|
+
parameters: Any
|
|
1050
|
+
execution_mode: "APIExecutionMode"
|
|
1051
|
+
id: Optional[UUID] = None
|
|
1052
|
+
parameter_value_source_id: Optional[UUID] = None
|
|
1053
|
+
created_at: Optional[datetime] = None
|
|
1054
|
+
updated_at: Optional[datetime] = None
|
|
1055
|
+
|
|
1056
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1057
|
+
"""Convert to dict format expected by backend."""
|
|
1058
|
+
result = {}
|
|
1059
|
+
if self.id is not None:
|
|
1060
|
+
result["id"] = self.id
|
|
1061
|
+
if self.parameter_value_source_id is not None:
|
|
1062
|
+
result["parameter_value_source_id"] = self.parameter_value_source_id
|
|
1063
|
+
result["action_type"] = self.action_type
|
|
1064
|
+
result["parameters"] = self.parameters
|
|
1065
|
+
result["execution_mode"] = self.execution_mode
|
|
1066
|
+
if self.created_at is not None:
|
|
1067
|
+
result["created_at"] = self.created_at
|
|
1068
|
+
if self.updated_at is not None:
|
|
1069
|
+
result["updated_at"] = self.updated_at
|
|
1070
|
+
return result
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
@dataclass
|
|
1074
|
+
class APIParameterInterpreter:
|
|
1075
|
+
"""APIParameterInterpreter matching Go backend structure."""
|
|
1076
|
+
|
|
1077
|
+
action_type: str
|
|
1078
|
+
parameters: Any
|
|
1079
|
+
interpreter_order: int
|
|
1080
|
+
id: Optional[UUID] = None
|
|
1081
|
+
parameter_definition_id: Optional[UUID] = None
|
|
1082
|
+
created_at: Optional[datetime] = None
|
|
1083
|
+
updated_at: Optional[datetime] = None
|
|
1084
|
+
|
|
1085
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1086
|
+
"""Convert to dict format expected by backend."""
|
|
1087
|
+
result = {}
|
|
1088
|
+
if self.id is not None:
|
|
1089
|
+
result["id"] = self.id
|
|
1090
|
+
if self.parameter_definition_id is not None:
|
|
1091
|
+
result["parameter_definition_id"] = self.parameter_definition_id
|
|
1092
|
+
result["action_type"] = self.action_type
|
|
1093
|
+
result["parameters"] = self.parameters
|
|
1094
|
+
result["interpreter_order"] = self.interpreter_order
|
|
1095
|
+
if self.created_at is not None:
|
|
1096
|
+
result["created_at"] = self.created_at
|
|
1097
|
+
if self.updated_at is not None:
|
|
1098
|
+
result["updated_at"] = self.updated_at
|
|
1099
|
+
return result
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
@dataclass
|
|
1103
|
+
class APIExecutionMode:
|
|
1104
|
+
"""APIExecutionMode matching Go backend structure."""
|
|
1105
|
+
|
|
1106
|
+
mode: str
|
|
1107
|
+
data: Any
|
|
1108
|
+
if_condition: Optional["APIConditionDefinition"] = None
|
|
1109
|
+
|
|
1110
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1111
|
+
"""Convert to dict format expected by backend."""
|
|
1112
|
+
result = {}
|
|
1113
|
+
result["mode"] = self.mode
|
|
1114
|
+
result["data"] = self.data
|
|
1115
|
+
if self.if_condition is not None:
|
|
1116
|
+
result["if_condition"] = self.if_condition
|
|
1117
|
+
return result
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
@dataclass
|
|
1121
|
+
class APIConditionDefinition:
|
|
1122
|
+
"""APIConditionDefinition matching Go backend structure."""
|
|
1123
|
+
|
|
1124
|
+
type: str
|
|
1125
|
+
conditions: List["APIConditionDefinition"] = None
|
|
1126
|
+
leaf: Any = None
|
|
1127
|
+
|
|
1128
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1129
|
+
"""Convert to dict format expected by backend."""
|
|
1130
|
+
result = {}
|
|
1131
|
+
result["type"] = self.type
|
|
1132
|
+
if self.conditions is not None:
|
|
1133
|
+
result["conditions"] = self.conditions
|
|
1134
|
+
if self.leaf is not None:
|
|
1135
|
+
result["leaf"] = self.leaf
|
|
1136
|
+
return result
|
|
1137
|
+
|
|
1138
|
+
|
|
1139
|
+
@dataclass
|
|
1140
|
+
class APITool:
|
|
1141
|
+
"""APITool matching Go backend structure."""
|
|
1142
|
+
|
|
1143
|
+
name: str
|
|
1144
|
+
description: str
|
|
1145
|
+
input_schema: Any
|
|
1146
|
+
action_type: str
|
|
1147
|
+
parameters: Any
|
|
1148
|
+
bot_output_visibility: str = None
|
|
1149
|
+
history_content_type: str = None
|
|
1150
|
+
ui_content_type: str = None
|
|
1151
|
+
as_root: bool = None
|
|
1152
|
+
|
|
1153
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1154
|
+
"""Convert to dict format expected by backend."""
|
|
1155
|
+
result = {}
|
|
1156
|
+
result["name"] = self.name
|
|
1157
|
+
result["description"] = self.description
|
|
1158
|
+
result["input_schema"] = self.input_schema
|
|
1159
|
+
result["action_type"] = self.action_type
|
|
1160
|
+
result["parameters"] = self.parameters
|
|
1161
|
+
if self.bot_output_visibility is not None:
|
|
1162
|
+
result["bot_output_visibility"] = self.bot_output_visibility
|
|
1163
|
+
if self.history_content_type is not None:
|
|
1164
|
+
result["history_content_type"] = self.history_content_type
|
|
1165
|
+
if self.ui_content_type is not None:
|
|
1166
|
+
result["ui_content_type"] = self.ui_content_type
|
|
1167
|
+
if self.as_root is not None:
|
|
1168
|
+
result["as_root"] = self.as_root
|
|
1169
|
+
return result
|
|
1170
|
+
|
|
1171
|
+
|
|
1172
|
+
@dataclass
|
|
1173
|
+
class APIResultHandler:
|
|
1174
|
+
"""APIResultHandler matching Go backend structure."""
|
|
1175
|
+
|
|
1176
|
+
type: str
|
|
1177
|
+
if_conditions: "APIConditionDefinition"
|
|
1178
|
+
result_handler_order: int
|
|
1179
|
+
output_content_type: str
|
|
1180
|
+
steps: List["APIStepWithHandlers"]
|
|
1181
|
+
history_content_type: Optional[str] = None
|
|
1182
|
+
ui_content_type: Optional[str] = None
|
|
1183
|
+
|
|
1184
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1185
|
+
"""Convert to dict format expected by backend."""
|
|
1186
|
+
result = {}
|
|
1187
|
+
result["type"] = self.type
|
|
1188
|
+
result["if_conditions"] = self.if_conditions
|
|
1189
|
+
result["result_handler_order"] = self.result_handler_order
|
|
1190
|
+
result["output_content_type"] = self.output_content_type
|
|
1191
|
+
if self.history_content_type is not None:
|
|
1192
|
+
result["history_content_type"] = self.history_content_type
|
|
1193
|
+
if self.ui_content_type is not None:
|
|
1194
|
+
result["ui_content_type"] = self.ui_content_type
|
|
1195
|
+
result["steps"] = self.steps
|
|
1196
|
+
return result
|
|
1197
|
+
|
|
1198
|
+
|
|
1199
|
+
@dataclass
|
|
1200
|
+
class APIParameterDefinition:
|
|
1201
|
+
"""APIParameterDefinition matching Go backend structure."""
|
|
1202
|
+
|
|
1203
|
+
name: str
|
|
1204
|
+
key: str
|
|
1205
|
+
type: str
|
|
1206
|
+
is_required: bool
|
|
1207
|
+
id: Optional[UUID] = None
|
|
1208
|
+
bot_id: Optional[UUID] = None
|
|
1209
|
+
description: Optional[str] = None
|
|
1210
|
+
created_at: Optional[datetime] = None
|
|
1211
|
+
updated_at: Optional[datetime] = None
|
|
1212
|
+
|
|
1213
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1214
|
+
"""Convert to dict format expected by backend."""
|
|
1215
|
+
result = {}
|
|
1216
|
+
if self.id is not None:
|
|
1217
|
+
result["id"] = self.id
|
|
1218
|
+
if self.bot_id is not None:
|
|
1219
|
+
result["bot_id"] = self.bot_id
|
|
1220
|
+
result["name"] = self.name
|
|
1221
|
+
result["key"] = self.key
|
|
1222
|
+
if self.description is not None:
|
|
1223
|
+
result["description"] = self.description
|
|
1224
|
+
result["type"] = self.type
|
|
1225
|
+
result["is_required"] = self.is_required
|
|
1226
|
+
if self.created_at is not None:
|
|
1227
|
+
result["created_at"] = self.created_at
|
|
1228
|
+
if self.updated_at is not None:
|
|
1229
|
+
result["updated_at"] = self.updated_at
|
|
1230
|
+
return result
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
@dataclass
|
|
1234
|
+
class APIStepWithHandlers:
|
|
1235
|
+
"""APIStepWithHandlers matching Go backend structure."""
|
|
1236
|
+
|
|
1237
|
+
step: "APIStep"
|
|
1238
|
+
result_handlers: List["APIResultHandler"]
|
|
1239
|
+
|
|
1240
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1241
|
+
"""Convert to dict format expected by backend."""
|
|
1242
|
+
result = {}
|
|
1243
|
+
result["step"] = self.step
|
|
1244
|
+
result["result_handlers"] = self.result_handlers
|
|
1245
|
+
return result
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
@dataclass
|
|
1249
|
+
class Dataset:
|
|
1250
|
+
"""Dataset matching Go backend structure."""
|
|
1251
|
+
|
|
1252
|
+
id: UUID
|
|
1253
|
+
type: DatasetType
|
|
1254
|
+
key: Optional[str] = None
|
|
1255
|
+
name: Optional[str] = None
|
|
1256
|
+
description: Optional[str] = None
|
|
1257
|
+
analysis_summary: Optional[str] = None
|
|
1258
|
+
last_analyzed: Optional[datetime] = None
|
|
1259
|
+
instructions: Optional[str] = None
|
|
1260
|
+
file: Optional[str] = None
|
|
1261
|
+
file_type: Optional[str] = None
|
|
1262
|
+
filename: Optional[str] = None
|
|
1263
|
+
url: Optional[str] = None
|
|
1264
|
+
integration_id: Optional[UUID] = None
|
|
1265
|
+
integration_config_id: Optional[UUID] = None
|
|
1266
|
+
integration_config: Optional[IntegrationConfig] = None
|
|
1267
|
+
encrypted_integration_credentials: Optional[Any] = None
|
|
1268
|
+
credential_schema: Optional[Any] = None
|
|
1269
|
+
codegen_details: Optional[CodegenDetails] = None
|
|
1270
|
+
analysis_details: Optional[AnalysisDetails] = None
|
|
1271
|
+
available_scopes: Optional[List[str]] = None
|
|
1272
|
+
parameters: Optional[Any] = None
|
|
1273
|
+
|
|
1274
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1275
|
+
"""Convert to dict format expected by backend."""
|
|
1276
|
+
result = {}
|
|
1277
|
+
result["id"] = self.id
|
|
1278
|
+
result["type"] = self.type
|
|
1279
|
+
if self.key is not None:
|
|
1280
|
+
result["key"] = self.key
|
|
1281
|
+
if self.name is not None:
|
|
1282
|
+
result["name"] = self.name
|
|
1283
|
+
if self.description is not None:
|
|
1284
|
+
result["description"] = self.description
|
|
1285
|
+
if self.analysis_summary is not None:
|
|
1286
|
+
result["analysis_summary"] = self.analysis_summary
|
|
1287
|
+
if self.last_analyzed is not None:
|
|
1288
|
+
result["last_analyzed"] = self.last_analyzed
|
|
1289
|
+
if self.instructions is not None:
|
|
1290
|
+
result["instructions"] = self.instructions
|
|
1291
|
+
if self.file is not None:
|
|
1292
|
+
result["file"] = self.file
|
|
1293
|
+
if self.file_type is not None:
|
|
1294
|
+
result["file_type"] = self.file_type
|
|
1295
|
+
if self.filename is not None:
|
|
1296
|
+
result["filename"] = self.filename
|
|
1297
|
+
if self.url is not None:
|
|
1298
|
+
result["url"] = self.url
|
|
1299
|
+
if self.integration_id is not None:
|
|
1300
|
+
result["integration_id"] = self.integration_id
|
|
1301
|
+
if self.integration_config_id is not None:
|
|
1302
|
+
result["integration_config_id"] = self.integration_config_id
|
|
1303
|
+
if self.integration_config is not None:
|
|
1304
|
+
result["integration_config"] = self.integration_config
|
|
1305
|
+
if self.encrypted_integration_credentials is not None:
|
|
1306
|
+
result["encrypted_integration_credentials"] = (
|
|
1307
|
+
self.encrypted_integration_credentials
|
|
1308
|
+
)
|
|
1309
|
+
if self.credential_schema is not None:
|
|
1310
|
+
result["credential_schema"] = self.credential_schema
|
|
1311
|
+
if self.codegen_details is not None:
|
|
1312
|
+
result["codegen_details"] = self.codegen_details
|
|
1313
|
+
if self.analysis_details is not None:
|
|
1314
|
+
result["analysis_details"] = self.analysis_details
|
|
1315
|
+
if self.available_scopes is not None:
|
|
1316
|
+
result["available_scopes"] = self.available_scopes
|
|
1317
|
+
if self.parameters is not None:
|
|
1318
|
+
result["parameters"] = self.parameters
|
|
1319
|
+
return result
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
@dataclass
|
|
1323
|
+
class BotResource:
|
|
1324
|
+
"""BotResource matching Go backend structure."""
|
|
1325
|
+
|
|
1326
|
+
id: int
|
|
1327
|
+
created_by: str
|
|
1328
|
+
extra: Any
|
|
1329
|
+
dataset: Optional[Dataset] = None
|
|
1330
|
+
|
|
1331
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1332
|
+
"""Convert to dict format expected by backend."""
|
|
1333
|
+
result = {}
|
|
1334
|
+
result["id"] = self.id
|
|
1335
|
+
if self.dataset is not None:
|
|
1336
|
+
result["dataset"] = self.dataset
|
|
1337
|
+
result["created_by"] = self.created_by
|
|
1338
|
+
result["extra"] = self.extra
|
|
1339
|
+
return result
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
@dataclass
|
|
1343
|
+
class UIConfigIcon:
|
|
1344
|
+
"""UIConfigIcon matching Go backend structure."""
|
|
1345
|
+
|
|
1346
|
+
set: str
|
|
1347
|
+
name: str
|
|
1348
|
+
|
|
1349
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1350
|
+
"""Convert to dict format expected by backend."""
|
|
1351
|
+
result = {}
|
|
1352
|
+
result["set"] = self.set
|
|
1353
|
+
result["name"] = self.name
|
|
1354
|
+
return result
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
@dataclass
|
|
1358
|
+
class UIConfig:
|
|
1359
|
+
"""UIConfig matching Go backend structure."""
|
|
1360
|
+
|
|
1361
|
+
brand_logo_icon: "UIConfigIcon"
|
|
1362
|
+
brand_color: str
|
|
1363
|
+
button_style: str
|
|
1364
|
+
|
|
1365
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1366
|
+
"""Convert to dict format expected by backend."""
|
|
1367
|
+
result = {}
|
|
1368
|
+
result["brand_logo_icon"] = self.brand_logo_icon
|
|
1369
|
+
result["brand_color"] = self.brand_color
|
|
1370
|
+
result["button_style"] = self.button_style
|
|
1371
|
+
return result
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
@dataclass
|
|
1375
|
+
class ErrorHandlingConfig:
|
|
1376
|
+
"""ErrorHandlingConfig matching Go backend structure."""
|
|
1377
|
+
|
|
1378
|
+
ignore_errors: List[str] = None
|
|
1379
|
+
error_path: str = None
|
|
1380
|
+
|
|
1381
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1382
|
+
"""Convert to dict format expected by backend."""
|
|
1383
|
+
result = {}
|
|
1384
|
+
if self.ignore_errors is not None:
|
|
1385
|
+
result["ignore_errors"] = self.ignore_errors
|
|
1386
|
+
if self.error_path is not None:
|
|
1387
|
+
result["error_path"] = self.error_path
|
|
1388
|
+
return result
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
@dataclass
|
|
1392
|
+
class SegmentLevel:
|
|
1393
|
+
"""SegmentLevel matching Go backend structure."""
|
|
1394
|
+
|
|
1395
|
+
name: str
|
|
1396
|
+
type: str
|
|
1397
|
+
selectable: bool
|
|
1398
|
+
url_template: str = None
|
|
1399
|
+
method: str = None
|
|
1400
|
+
body: str = None
|
|
1401
|
+
id_path: str = None
|
|
1402
|
+
id_regex: str = None
|
|
1403
|
+
name_path: str = None
|
|
1404
|
+
parent_key: str = None
|
|
1405
|
+
required_credentials: List[str] = None
|
|
1406
|
+
|
|
1407
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1408
|
+
"""Convert to dict format expected by backend."""
|
|
1409
|
+
result = {}
|
|
1410
|
+
result["name"] = self.name
|
|
1411
|
+
result["type"] = self.type
|
|
1412
|
+
result["selectable"] = self.selectable
|
|
1413
|
+
if self.url_template is not None:
|
|
1414
|
+
result["url_template"] = self.url_template
|
|
1415
|
+
if self.method is not None:
|
|
1416
|
+
result["method"] = self.method
|
|
1417
|
+
if self.body is not None:
|
|
1418
|
+
result["body"] = self.body
|
|
1419
|
+
if self.id_path is not None:
|
|
1420
|
+
result["id_path"] = self.id_path
|
|
1421
|
+
if self.id_regex is not None:
|
|
1422
|
+
result["id_regex"] = self.id_regex
|
|
1423
|
+
if self.name_path is not None:
|
|
1424
|
+
result["name_path"] = self.name_path
|
|
1425
|
+
if self.parent_key is not None:
|
|
1426
|
+
result["parent_key"] = self.parent_key
|
|
1427
|
+
if self.required_credentials is not None:
|
|
1428
|
+
result["required_credentials"] = self.required_credentials
|
|
1429
|
+
return result
|
|
1430
|
+
|
|
1431
|
+
|
|
1432
|
+
@dataclass
|
|
1433
|
+
class SegmentConfig:
|
|
1434
|
+
"""SegmentConfig matching Go backend structure."""
|
|
1435
|
+
|
|
1436
|
+
selection_type: Any
|
|
1437
|
+
description: str
|
|
1438
|
+
hierarchical: bool
|
|
1439
|
+
levels: List["SegmentLevel"]
|
|
1440
|
+
min_selections: Optional[int] = None
|
|
1441
|
+
max_selections: Optional[int] = None
|
|
1442
|
+
base_url: str = None
|
|
1443
|
+
error_handling: Optional["ErrorHandlingConfig"] = None
|
|
1444
|
+
|
|
1445
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1446
|
+
"""Convert to dict format expected by backend."""
|
|
1447
|
+
result = {}
|
|
1448
|
+
result["selection_type"] = self.selection_type
|
|
1449
|
+
if self.min_selections is not None:
|
|
1450
|
+
result["min_selections"] = self.min_selections
|
|
1451
|
+
if self.max_selections is not None:
|
|
1452
|
+
result["max_selections"] = self.max_selections
|
|
1453
|
+
result["description"] = self.description
|
|
1454
|
+
result["hierarchical"] = self.hierarchical
|
|
1455
|
+
if self.base_url is not None:
|
|
1456
|
+
result["base_url"] = self.base_url
|
|
1457
|
+
result["levels"] = self.levels
|
|
1458
|
+
if self.error_handling is not None:
|
|
1459
|
+
result["error_handling"] = self.error_handling
|
|
1460
|
+
return result
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
@dataclass
|
|
1464
|
+
class ResourceTypeConfig:
|
|
1465
|
+
"""ResourceTypeConfig matching Go backend structure."""
|
|
1466
|
+
|
|
1467
|
+
type: str
|
|
1468
|
+
url_template: str
|
|
1469
|
+
id_path: str
|
|
1470
|
+
name_path: str
|
|
1471
|
+
method: str = None
|
|
1472
|
+
body: str = None
|
|
1473
|
+
description_path: str = None
|
|
1474
|
+
|
|
1475
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1476
|
+
"""Convert to dict format expected by backend."""
|
|
1477
|
+
result = {}
|
|
1478
|
+
result["type"] = self.type
|
|
1479
|
+
result["url_template"] = self.url_template
|
|
1480
|
+
if self.method is not None:
|
|
1481
|
+
result["method"] = self.method
|
|
1482
|
+
if self.body is not None:
|
|
1483
|
+
result["body"] = self.body
|
|
1484
|
+
result["id_path"] = self.id_path
|
|
1485
|
+
result["name_path"] = self.name_path
|
|
1486
|
+
if self.description_path is not None:
|
|
1487
|
+
result["description_path"] = self.description_path
|
|
1488
|
+
return result
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
@dataclass
|
|
1492
|
+
class DatasetResourceDiscoveryConfig:
|
|
1493
|
+
"""DatasetResourceDiscoveryConfig matching Go backend structure."""
|
|
1494
|
+
|
|
1495
|
+
min_resources_required: int
|
|
1496
|
+
table_query: str = None
|
|
1497
|
+
relationship_query: str = None
|
|
1498
|
+
index_query: str = None
|
|
1499
|
+
constraint_query: str = None
|
|
1500
|
+
statistics_query: str = None
|
|
1501
|
+
size_query: str = None
|
|
1502
|
+
base_url: str = None
|
|
1503
|
+
resource_types: List["ResourceTypeConfig"] = None
|
|
1504
|
+
error_handling: Optional["ErrorHandlingConfig"] = None
|
|
1505
|
+
|
|
1506
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1507
|
+
"""Convert to dict format expected by backend."""
|
|
1508
|
+
result = {}
|
|
1509
|
+
result["min_resources_required"] = self.min_resources_required
|
|
1510
|
+
if self.table_query is not None:
|
|
1511
|
+
result["table_query"] = self.table_query
|
|
1512
|
+
if self.relationship_query is not None:
|
|
1513
|
+
result["relationship_query"] = self.relationship_query
|
|
1514
|
+
if self.index_query is not None:
|
|
1515
|
+
result["index_query"] = self.index_query
|
|
1516
|
+
if self.constraint_query is not None:
|
|
1517
|
+
result["constraint_query"] = self.constraint_query
|
|
1518
|
+
if self.statistics_query is not None:
|
|
1519
|
+
result["statistics_query"] = self.statistics_query
|
|
1520
|
+
if self.size_query is not None:
|
|
1521
|
+
result["size_query"] = self.size_query
|
|
1522
|
+
if self.base_url is not None:
|
|
1523
|
+
result["base_url"] = self.base_url
|
|
1524
|
+
if self.resource_types is not None:
|
|
1525
|
+
result["resource_types"] = self.resource_types
|
|
1526
|
+
if self.error_handling is not None:
|
|
1527
|
+
result["error_handling"] = self.error_handling
|
|
1528
|
+
return result
|
|
1529
|
+
|
|
1530
|
+
|
|
1531
|
+
@dataclass
|
|
1532
|
+
class ExpiryConfig:
|
|
1533
|
+
"""ExpiryConfig matching Go backend structure."""
|
|
1534
|
+
|
|
1535
|
+
type: Any
|
|
1536
|
+
duration: Any = None
|
|
1537
|
+
field_name: str = None
|
|
1538
|
+
refresh_token_duration: Optional[Any] = None
|
|
1539
|
+
|
|
1540
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1541
|
+
"""Convert to dict format expected by backend."""
|
|
1542
|
+
result = {}
|
|
1543
|
+
result["type"] = self.type
|
|
1544
|
+
if self.duration is not None:
|
|
1545
|
+
result["duration"] = self.duration
|
|
1546
|
+
if self.field_name is not None:
|
|
1547
|
+
result["field_name"] = self.field_name
|
|
1548
|
+
if self.refresh_token_duration is not None:
|
|
1549
|
+
result["refresh_token_duration"] = self.refresh_token_duration
|
|
1550
|
+
return result
|
|
1551
|
+
|
|
1552
|
+
|
|
1553
|
+
@dataclass
|
|
1554
|
+
class SegmentOption:
|
|
1555
|
+
"""SegmentOption matching Go backend structure."""
|
|
1556
|
+
|
|
1557
|
+
id: str
|
|
1558
|
+
name: str
|
|
1559
|
+
type: str
|
|
1560
|
+
metadata: Any
|
|
1561
|
+
children: List["SegmentOption"]
|
|
1562
|
+
parent_id: Optional[str] = None
|
|
1563
|
+
|
|
1564
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1565
|
+
"""Convert to dict format expected by backend."""
|
|
1566
|
+
result = {}
|
|
1567
|
+
result["id"] = self.id
|
|
1568
|
+
result["name"] = self.name
|
|
1569
|
+
result["type"] = self.type
|
|
1570
|
+
if self.parent_id is not None:
|
|
1571
|
+
result["parent_id"] = self.parent_id
|
|
1572
|
+
result["metadata"] = self.metadata
|
|
1573
|
+
result["children"] = self.children
|
|
1574
|
+
return result
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
@dataclass
|
|
1578
|
+
class IntegrationDefinition:
|
|
1579
|
+
"""IntegrationDefinition matching Go backend structure."""
|
|
1580
|
+
|
|
1581
|
+
name: str
|
|
1582
|
+
key: str
|
|
1583
|
+
type: Any
|
|
1584
|
+
auth_types: List[Any]
|
|
1585
|
+
status: Any
|
|
1586
|
+
description: Optional[str] = None
|
|
1587
|
+
provider_name: Optional[str] = None
|
|
1588
|
+
documentation_url: Optional[str] = None
|
|
1589
|
+
openapi_documentation_url: Optional[str] = None
|
|
1590
|
+
llms_txt_url: Optional[str] = None
|
|
1591
|
+
healthcheck_url: Optional[str] = None
|
|
1592
|
+
auth_url: Optional[str] = None
|
|
1593
|
+
token_url: Optional[str] = None
|
|
1594
|
+
client_id: Optional[str] = None
|
|
1595
|
+
client_secret: Optional[str] = None
|
|
1596
|
+
available_scopes: List[str] = None
|
|
1597
|
+
optional_scopes: List[str] = None
|
|
1598
|
+
scope_separator: Optional[str] = None
|
|
1599
|
+
api_version: Optional[str] = None
|
|
1600
|
+
api_version_description: Optional[str] = None
|
|
1601
|
+
credential_schema: Any = None
|
|
1602
|
+
ui_config: Optional["UIConfig"] = None
|
|
1603
|
+
codegen_details: Optional[CodegenDetails] = None
|
|
1604
|
+
analysis_details: Optional[AnalysisDetails] = None
|
|
1605
|
+
segment_config: Optional["SegmentConfig"] = None
|
|
1606
|
+
dataset_resource_discovery_config: Optional["DatasetResourceDiscoveryConfig"] = None
|
|
1607
|
+
expiry_config: Optional["ExpiryConfig"] = None
|
|
1608
|
+
provider_credentials: Any = None
|
|
1609
|
+
default_resource_attach_type: Optional[str] = None
|
|
1610
|
+
|
|
1611
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1612
|
+
"""Convert to dict format expected by backend."""
|
|
1613
|
+
result = {}
|
|
1614
|
+
result["name"] = self.name
|
|
1615
|
+
result["key"] = self.key
|
|
1616
|
+
result["type"] = self.type
|
|
1617
|
+
result["auth_types"] = self.auth_types
|
|
1618
|
+
result["status"] = self.status
|
|
1619
|
+
if self.description is not None:
|
|
1620
|
+
result["description"] = self.description
|
|
1621
|
+
if self.provider_name is not None:
|
|
1622
|
+
result["provider_name"] = self.provider_name
|
|
1623
|
+
if self.documentation_url is not None:
|
|
1624
|
+
result["documentation_url"] = self.documentation_url
|
|
1625
|
+
if self.openapi_documentation_url is not None:
|
|
1626
|
+
result["openapi_documentation_url"] = self.openapi_documentation_url
|
|
1627
|
+
if self.llms_txt_url is not None:
|
|
1628
|
+
result["llms_txt_url"] = self.llms_txt_url
|
|
1629
|
+
if self.healthcheck_url is not None:
|
|
1630
|
+
result["healthcheck_url"] = self.healthcheck_url
|
|
1631
|
+
if self.auth_url is not None:
|
|
1632
|
+
result["auth_url"] = self.auth_url
|
|
1633
|
+
if self.token_url is not None:
|
|
1634
|
+
result["token_url"] = self.token_url
|
|
1635
|
+
if self.client_id is not None:
|
|
1636
|
+
result["client_id"] = self.client_id
|
|
1637
|
+
if self.client_secret is not None:
|
|
1638
|
+
result["client_secret"] = self.client_secret
|
|
1639
|
+
if self.available_scopes is not None:
|
|
1640
|
+
result["available_scopes"] = self.available_scopes
|
|
1641
|
+
if self.optional_scopes is not None:
|
|
1642
|
+
result["optional_scopes"] = self.optional_scopes
|
|
1643
|
+
if self.scope_separator is not None:
|
|
1644
|
+
result["scope_separator"] = self.scope_separator
|
|
1645
|
+
if self.api_version is not None:
|
|
1646
|
+
result["api_version"] = self.api_version
|
|
1647
|
+
if self.api_version_description is not None:
|
|
1648
|
+
result["api_version_description"] = self.api_version_description
|
|
1649
|
+
if self.credential_schema is not None:
|
|
1650
|
+
result["credential_schema"] = self.credential_schema
|
|
1651
|
+
if self.ui_config is not None:
|
|
1652
|
+
result["ui_config"] = self.ui_config
|
|
1653
|
+
if self.codegen_details is not None:
|
|
1654
|
+
result["codegen_details"] = self.codegen_details
|
|
1655
|
+
if self.analysis_details is not None:
|
|
1656
|
+
result["analysis_details"] = self.analysis_details
|
|
1657
|
+
if self.segment_config is not None:
|
|
1658
|
+
result["segment_config"] = self.segment_config
|
|
1659
|
+
if self.dataset_resource_discovery_config is not None:
|
|
1660
|
+
result["dataset_resource_discovery_config"] = (
|
|
1661
|
+
self.dataset_resource_discovery_config
|
|
1662
|
+
)
|
|
1663
|
+
if self.expiry_config is not None:
|
|
1664
|
+
result["expiry_config"] = self.expiry_config
|
|
1665
|
+
if self.provider_credentials is not None:
|
|
1666
|
+
result["provider_credentials"] = self.provider_credentials
|
|
1667
|
+
if self.default_resource_attach_type is not None:
|
|
1668
|
+
result["default_resource_attach_type"] = self.default_resource_attach_type
|
|
1669
|
+
return result
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
@dataclass
|
|
1673
|
+
class IntegrationConfig:
|
|
1674
|
+
"""IntegrationConfig matching Go backend structure."""
|
|
1675
|
+
|
|
1676
|
+
definition: "IntegrationDefinition"
|
|
1677
|
+
source: str
|
|
1678
|
+
file_path: str = None
|
|
1679
|
+
|
|
1680
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1681
|
+
"""Convert to dict format expected by backend."""
|
|
1682
|
+
result = {}
|
|
1683
|
+
result["definition"] = self.definition
|
|
1684
|
+
result["source"] = self.source
|
|
1685
|
+
if self.file_path is not None:
|
|
1686
|
+
result["file_path"] = self.file_path
|
|
1687
|
+
return result
|
|
1688
|
+
|
|
1689
|
+
|
|
1690
|
+
@dataclass
|
|
1691
|
+
class PythonIntegrationInstance:
|
|
1692
|
+
"""PythonIntegrationInstance matching Go backend structure."""
|
|
1693
|
+
|
|
1694
|
+
config: IntegrationConfig
|
|
1695
|
+
credentials: Any
|
|
1696
|
+
methods: List[str] = None
|
|
1697
|
+
|
|
1698
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1699
|
+
"""Convert to dict format expected by backend."""
|
|
1700
|
+
result = {}
|
|
1701
|
+
result["config"] = self.config
|
|
1702
|
+
result["credentials"] = self.credentials
|
|
1703
|
+
if self.methods is not None:
|
|
1704
|
+
result["methods"] = self.methods
|
|
1705
|
+
return result
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
@dataclass
|
|
1709
|
+
class IntegrationDiscovery:
|
|
1710
|
+
"""IntegrationDiscovery matching Go backend structure."""
|
|
1711
|
+
|
|
1712
|
+
config: IntegrationConfig
|
|
1713
|
+
file_path: str
|
|
1714
|
+
source_code: str
|
|
1715
|
+
instance: Optional["PythonIntegrationInstance"] = None
|
|
1716
|
+
|
|
1717
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1718
|
+
"""Convert to dict format expected by backend."""
|
|
1719
|
+
result = {}
|
|
1720
|
+
result["config"] = self.config
|
|
1721
|
+
if self.instance is not None:
|
|
1722
|
+
result["instance"] = self.instance
|
|
1723
|
+
result["file_path"] = self.file_path
|
|
1724
|
+
result["source_code"] = self.source_code
|
|
1725
|
+
return result
|
|
1726
|
+
|
|
1727
|
+
|
|
1728
|
+
@dataclass
|
|
1729
|
+
class UpsertIntegrationRequest:
|
|
1730
|
+
"""UpsertIntegrationRequest matching Go backend structure."""
|
|
1731
|
+
|
|
1732
|
+
integration: "IntegrationDefinition"
|
|
1733
|
+
source: str
|
|
1734
|
+
|
|
1735
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1736
|
+
"""Convert to dict format expected by backend."""
|
|
1737
|
+
result = {}
|
|
1738
|
+
result["integration"] = self.integration
|
|
1739
|
+
result["source"] = self.source
|
|
1740
|
+
return result
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
@dataclass
|
|
1744
|
+
class UpsertIntegrationResponse:
|
|
1745
|
+
"""UpsertIntegrationResponse matching Go backend structure."""
|
|
1746
|
+
|
|
1747
|
+
integration_id: str
|
|
1748
|
+
status: str
|
|
1749
|
+
|
|
1750
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1751
|
+
"""Convert to dict format expected by backend."""
|
|
1752
|
+
result = {}
|
|
1753
|
+
result["integration_id"] = self.integration_id
|
|
1754
|
+
result["status"] = self.status
|
|
1755
|
+
return result
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
@dataclass
|
|
1759
|
+
class ListIntegrationsResponse:
|
|
1760
|
+
"""ListIntegrationsResponse matching Go backend structure."""
|
|
1761
|
+
|
|
1762
|
+
integrations: List["IntegrationDefinition"]
|
|
1763
|
+
|
|
1764
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1765
|
+
"""Convert to dict format expected by backend."""
|
|
1766
|
+
result = {}
|
|
1767
|
+
result["integrations"] = self.integrations
|
|
1768
|
+
return result
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
@dataclass
|
|
1772
|
+
class ExportIntegrationsResponse:
|
|
1773
|
+
"""ExportIntegrationsResponse matching Go backend structure."""
|
|
1774
|
+
|
|
1775
|
+
integrations: Any
|
|
1776
|
+
|
|
1777
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1778
|
+
"""Convert to dict format expected by backend."""
|
|
1779
|
+
result = {}
|
|
1780
|
+
result["integrations"] = self.integrations
|
|
1781
|
+
return result
|
|
1782
|
+
|
|
1783
|
+
|
|
1784
|
+
@dataclass
|
|
1785
|
+
class Memory:
|
|
1786
|
+
"""Memory matching Go backend structure."""
|
|
1787
|
+
|
|
1788
|
+
id: str
|
|
1789
|
+
content: str
|
|
1790
|
+
description: str
|
|
1791
|
+
state: str
|
|
1792
|
+
created_by_entity_type: str
|
|
1793
|
+
created_by_id: str
|
|
1794
|
+
created_at: datetime
|
|
1795
|
+
updated_at: datetime
|
|
1796
|
+
type: str
|
|
1797
|
+
current_version: int
|
|
1798
|
+
approval_status: str
|
|
1799
|
+
tags: List[str] = None
|
|
1800
|
+
estimated_stale_at: Optional[datetime] = None
|
|
1801
|
+
stale_when_text: Optional[str] = None
|
|
1802
|
+
created_from: Optional[str] = None
|
|
1803
|
+
organization_id: Optional[str] = None
|
|
1804
|
+
extra: Any = None
|
|
1805
|
+
dataset_id: Optional[str] = None
|
|
1806
|
+
integration_config_id: Optional[str] = None
|
|
1807
|
+
user_id: Optional[str] = None
|
|
1808
|
+
thread_id: Optional[str] = None
|
|
1809
|
+
|
|
1810
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1811
|
+
"""Convert to dict format expected by backend."""
|
|
1812
|
+
result = {}
|
|
1813
|
+
result["id"] = self.id
|
|
1814
|
+
result["content"] = self.content
|
|
1815
|
+
result["description"] = self.description
|
|
1816
|
+
if self.tags is not None:
|
|
1817
|
+
result["tags"] = self.tags
|
|
1818
|
+
result["state"] = self.state
|
|
1819
|
+
if self.estimated_stale_at is not None:
|
|
1820
|
+
result["estimated_stale_at"] = self.estimated_stale_at
|
|
1821
|
+
if self.stale_when_text is not None:
|
|
1822
|
+
result["stale_when_text"] = self.stale_when_text
|
|
1823
|
+
result["created_by_entity_type"] = self.created_by_entity_type
|
|
1824
|
+
result["created_by_id"] = self.created_by_id
|
|
1825
|
+
if self.created_from is not None:
|
|
1826
|
+
result["created_from"] = self.created_from
|
|
1827
|
+
if self.organization_id is not None:
|
|
1828
|
+
result["organization_id"] = self.organization_id
|
|
1829
|
+
if self.extra is not None:
|
|
1830
|
+
result["extra"] = self.extra
|
|
1831
|
+
result["created_at"] = self.created_at
|
|
1832
|
+
result["updated_at"] = self.updated_at
|
|
1833
|
+
result["type"] = self.type
|
|
1834
|
+
if self.dataset_id is not None:
|
|
1835
|
+
result["dataset_id"] = self.dataset_id
|
|
1836
|
+
if self.integration_config_id is not None:
|
|
1837
|
+
result["integration_config_id"] = self.integration_config_id
|
|
1838
|
+
if self.user_id is not None:
|
|
1839
|
+
result["user_id"] = self.user_id
|
|
1840
|
+
if self.thread_id is not None:
|
|
1841
|
+
result["thread_id"] = self.thread_id
|
|
1842
|
+
result["current_version"] = self.current_version
|
|
1843
|
+
result["approval_status"] = self.approval_status
|
|
1844
|
+
return result
|
|
1845
|
+
|
|
1846
|
+
|
|
1847
|
+
@dataclass
|
|
1848
|
+
class Resource:
|
|
1849
|
+
"""Resource matching Go backend structure."""
|
|
1850
|
+
|
|
1851
|
+
id: str
|
|
1852
|
+
key: str
|
|
1853
|
+
name: str
|
|
1854
|
+
type: Any
|
|
1855
|
+
created_at: datetime
|
|
1856
|
+
updated_at: datetime
|
|
1857
|
+
integration_config_id: str
|
|
1858
|
+
state: Any
|
|
1859
|
+
attach_type: Any
|
|
1860
|
+
dataset_id: str
|
|
1861
|
+
description: Optional[str] = None
|
|
1862
|
+
use_cases: List[str] = None
|
|
1863
|
+
tags: List[str] = None
|
|
1864
|
+
instructions: Optional[str] = None
|
|
1865
|
+
|
|
1866
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1867
|
+
"""Convert to dict format expected by backend."""
|
|
1868
|
+
result = {}
|
|
1869
|
+
result["id"] = self.id
|
|
1870
|
+
result["key"] = self.key
|
|
1871
|
+
result["name"] = self.name
|
|
1872
|
+
result["type"] = self.type
|
|
1873
|
+
if self.description is not None:
|
|
1874
|
+
result["description"] = self.description
|
|
1875
|
+
if self.use_cases is not None:
|
|
1876
|
+
result["use_cases"] = self.use_cases
|
|
1877
|
+
if self.tags is not None:
|
|
1878
|
+
result["tags"] = self.tags
|
|
1879
|
+
result["created_at"] = self.created_at
|
|
1880
|
+
result["updated_at"] = self.updated_at
|
|
1881
|
+
result["integration_config_id"] = self.integration_config_id
|
|
1882
|
+
result["state"] = self.state
|
|
1883
|
+
result["attach_type"] = self.attach_type
|
|
1884
|
+
result["dataset_id"] = self.dataset_id
|
|
1885
|
+
if self.instructions is not None:
|
|
1886
|
+
result["instructions"] = self.instructions
|
|
1887
|
+
return result
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
# Integration classes from Go structs
|
|
1891
|
+
@dataclass
|
|
1892
|
+
class UIConfigIcon:
|
|
1893
|
+
"""UIConfigIcon matching Go backend structure."""
|
|
1894
|
+
|
|
1895
|
+
set: str
|
|
1896
|
+
name: str
|
|
1897
|
+
|
|
1898
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1899
|
+
"""Convert to dict format expected by backend."""
|
|
1900
|
+
result = {}
|
|
1901
|
+
result["set"] = self.set
|
|
1902
|
+
result["name"] = self.name
|
|
1903
|
+
return result
|
|
1904
|
+
|
|
1905
|
+
|
|
1906
|
+
@dataclass
|
|
1907
|
+
class UIConfig:
|
|
1908
|
+
"""UIConfig matching Go backend structure."""
|
|
1909
|
+
|
|
1910
|
+
brand_logo_icon: "UIConfigIcon"
|
|
1911
|
+
brand_color: str
|
|
1912
|
+
button_style: str
|
|
1913
|
+
|
|
1914
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1915
|
+
"""Convert to dict format expected by backend."""
|
|
1916
|
+
result = {}
|
|
1917
|
+
result["brand_logo_icon"] = self.brand_logo_icon
|
|
1918
|
+
result["brand_color"] = self.brand_color
|
|
1919
|
+
result["button_style"] = self.button_style
|
|
1920
|
+
return result
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
@dataclass
|
|
1924
|
+
class ErrorHandlingConfig:
|
|
1925
|
+
"""ErrorHandlingConfig matching Go backend structure."""
|
|
1926
|
+
|
|
1927
|
+
ignore_errors: List[str] = None
|
|
1928
|
+
error_path: str = None
|
|
1929
|
+
|
|
1930
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1931
|
+
"""Convert to dict format expected by backend."""
|
|
1932
|
+
result = {}
|
|
1933
|
+
if self.ignore_errors is not None:
|
|
1934
|
+
result["ignore_errors"] = self.ignore_errors
|
|
1935
|
+
if self.error_path is not None:
|
|
1936
|
+
result["error_path"] = self.error_path
|
|
1937
|
+
return result
|
|
1938
|
+
|
|
1939
|
+
|
|
1940
|
+
@dataclass
|
|
1941
|
+
class SegmentLevel:
|
|
1942
|
+
"""SegmentLevel matching Go backend structure."""
|
|
1943
|
+
|
|
1944
|
+
name: str
|
|
1945
|
+
type: str
|
|
1946
|
+
selectable: bool
|
|
1947
|
+
url_template: str = None
|
|
1948
|
+
method: str = None
|
|
1949
|
+
body: str = None
|
|
1950
|
+
id_path: str = None
|
|
1951
|
+
id_regex: str = None
|
|
1952
|
+
name_path: str = None
|
|
1953
|
+
parent_key: str = None
|
|
1954
|
+
required_credentials: List[str] = None
|
|
1955
|
+
|
|
1956
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1957
|
+
"""Convert to dict format expected by backend."""
|
|
1958
|
+
result = {}
|
|
1959
|
+
result["name"] = self.name
|
|
1960
|
+
result["type"] = self.type
|
|
1961
|
+
result["selectable"] = self.selectable
|
|
1962
|
+
if self.url_template is not None:
|
|
1963
|
+
result["url_template"] = self.url_template
|
|
1964
|
+
if self.method is not None:
|
|
1965
|
+
result["method"] = self.method
|
|
1966
|
+
if self.body is not None:
|
|
1967
|
+
result["body"] = self.body
|
|
1968
|
+
if self.id_path is not None:
|
|
1969
|
+
result["id_path"] = self.id_path
|
|
1970
|
+
if self.id_regex is not None:
|
|
1971
|
+
result["id_regex"] = self.id_regex
|
|
1972
|
+
if self.name_path is not None:
|
|
1973
|
+
result["name_path"] = self.name_path
|
|
1974
|
+
if self.parent_key is not None:
|
|
1975
|
+
result["parent_key"] = self.parent_key
|
|
1976
|
+
if self.required_credentials is not None:
|
|
1977
|
+
result["required_credentials"] = self.required_credentials
|
|
1978
|
+
return result
|
|
1979
|
+
|
|
1980
|
+
|
|
1981
|
+
@dataclass
|
|
1982
|
+
class SegmentConfig:
|
|
1983
|
+
"""SegmentConfig matching Go backend structure."""
|
|
1984
|
+
|
|
1985
|
+
selection_type: Any
|
|
1986
|
+
description: str
|
|
1987
|
+
hierarchical: bool
|
|
1988
|
+
levels: List["SegmentLevel"]
|
|
1989
|
+
min_selections: Optional[int] = None
|
|
1990
|
+
max_selections: Optional[int] = None
|
|
1991
|
+
base_url: str = None
|
|
1992
|
+
error_handling: Optional["ErrorHandlingConfig"] = None
|
|
1993
|
+
|
|
1994
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
1995
|
+
"""Convert to dict format expected by backend."""
|
|
1996
|
+
result = {}
|
|
1997
|
+
result["selection_type"] = self.selection_type
|
|
1998
|
+
if self.min_selections is not None:
|
|
1999
|
+
result["min_selections"] = self.min_selections
|
|
2000
|
+
if self.max_selections is not None:
|
|
2001
|
+
result["max_selections"] = self.max_selections
|
|
2002
|
+
result["description"] = self.description
|
|
2003
|
+
result["hierarchical"] = self.hierarchical
|
|
2004
|
+
if self.base_url is not None:
|
|
2005
|
+
result["base_url"] = self.base_url
|
|
2006
|
+
result["levels"] = self.levels
|
|
2007
|
+
if self.error_handling is not None:
|
|
2008
|
+
result["error_handling"] = self.error_handling
|
|
2009
|
+
return result
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
@dataclass
|
|
2013
|
+
class ResourceTypeConfig:
|
|
2014
|
+
"""ResourceTypeConfig matching Go backend structure."""
|
|
2015
|
+
|
|
2016
|
+
type: str
|
|
2017
|
+
url_template: str
|
|
2018
|
+
id_path: str
|
|
2019
|
+
name_path: str
|
|
2020
|
+
method: str = None
|
|
2021
|
+
body: str = None
|
|
2022
|
+
description_path: str = None
|
|
2023
|
+
|
|
2024
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2025
|
+
"""Convert to dict format expected by backend."""
|
|
2026
|
+
result = {}
|
|
2027
|
+
result["type"] = self.type
|
|
2028
|
+
result["url_template"] = self.url_template
|
|
2029
|
+
if self.method is not None:
|
|
2030
|
+
result["method"] = self.method
|
|
2031
|
+
if self.body is not None:
|
|
2032
|
+
result["body"] = self.body
|
|
2033
|
+
result["id_path"] = self.id_path
|
|
2034
|
+
result["name_path"] = self.name_path
|
|
2035
|
+
if self.description_path is not None:
|
|
2036
|
+
result["description_path"] = self.description_path
|
|
2037
|
+
return result
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
@dataclass
|
|
2041
|
+
class DatasetResourceDiscoveryConfig:
|
|
2042
|
+
"""DatasetResourceDiscoveryConfig matching Go backend structure."""
|
|
2043
|
+
|
|
2044
|
+
min_resources_required: int
|
|
2045
|
+
table_query: str = None
|
|
2046
|
+
relationship_query: str = None
|
|
2047
|
+
index_query: str = None
|
|
2048
|
+
constraint_query: str = None
|
|
2049
|
+
statistics_query: str = None
|
|
2050
|
+
size_query: str = None
|
|
2051
|
+
base_url: str = None
|
|
2052
|
+
resource_types: List["ResourceTypeConfig"] = None
|
|
2053
|
+
error_handling: Optional["ErrorHandlingConfig"] = None
|
|
2054
|
+
|
|
2055
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2056
|
+
"""Convert to dict format expected by backend."""
|
|
2057
|
+
result = {}
|
|
2058
|
+
result["min_resources_required"] = self.min_resources_required
|
|
2059
|
+
if self.table_query is not None:
|
|
2060
|
+
result["table_query"] = self.table_query
|
|
2061
|
+
if self.relationship_query is not None:
|
|
2062
|
+
result["relationship_query"] = self.relationship_query
|
|
2063
|
+
if self.index_query is not None:
|
|
2064
|
+
result["index_query"] = self.index_query
|
|
2065
|
+
if self.constraint_query is not None:
|
|
2066
|
+
result["constraint_query"] = self.constraint_query
|
|
2067
|
+
if self.statistics_query is not None:
|
|
2068
|
+
result["statistics_query"] = self.statistics_query
|
|
2069
|
+
if self.size_query is not None:
|
|
2070
|
+
result["size_query"] = self.size_query
|
|
2071
|
+
if self.base_url is not None:
|
|
2072
|
+
result["base_url"] = self.base_url
|
|
2073
|
+
if self.resource_types is not None:
|
|
2074
|
+
result["resource_types"] = self.resource_types
|
|
2075
|
+
if self.error_handling is not None:
|
|
2076
|
+
result["error_handling"] = self.error_handling
|
|
2077
|
+
return result
|
|
2078
|
+
|
|
2079
|
+
|
|
2080
|
+
@dataclass
|
|
2081
|
+
class ExpiryConfig:
|
|
2082
|
+
"""ExpiryConfig matching Go backend structure."""
|
|
2083
|
+
|
|
2084
|
+
type: Any
|
|
2085
|
+
duration: Any = None
|
|
2086
|
+
field_name: str = None
|
|
2087
|
+
refresh_token_duration: Optional[Any] = None
|
|
2088
|
+
|
|
2089
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2090
|
+
"""Convert to dict format expected by backend."""
|
|
2091
|
+
result = {}
|
|
2092
|
+
result["type"] = self.type
|
|
2093
|
+
if self.duration is not None:
|
|
2094
|
+
result["duration"] = self.duration
|
|
2095
|
+
if self.field_name is not None:
|
|
2096
|
+
result["field_name"] = self.field_name
|
|
2097
|
+
if self.refresh_token_duration is not None:
|
|
2098
|
+
result["refresh_token_duration"] = self.refresh_token_duration
|
|
2099
|
+
return result
|
|
2100
|
+
|
|
2101
|
+
|
|
2102
|
+
@dataclass
|
|
2103
|
+
class SegmentOption:
|
|
2104
|
+
"""SegmentOption matching Go backend structure."""
|
|
2105
|
+
|
|
2106
|
+
id: str
|
|
2107
|
+
name: str
|
|
2108
|
+
type: str
|
|
2109
|
+
metadata: Any
|
|
2110
|
+
children: List["SegmentOption"]
|
|
2111
|
+
parent_id: Optional[str] = None
|
|
2112
|
+
|
|
2113
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2114
|
+
"""Convert to dict format expected by backend."""
|
|
2115
|
+
result = {}
|
|
2116
|
+
result["id"] = self.id
|
|
2117
|
+
result["name"] = self.name
|
|
2118
|
+
result["type"] = self.type
|
|
2119
|
+
if self.parent_id is not None:
|
|
2120
|
+
result["parent_id"] = self.parent_id
|
|
2121
|
+
result["metadata"] = self.metadata
|
|
2122
|
+
result["children"] = self.children
|
|
2123
|
+
return result
|
|
2124
|
+
|
|
2125
|
+
|
|
2126
|
+
@dataclass
|
|
2127
|
+
class IntegrationDefinition:
|
|
2128
|
+
"""IntegrationDefinition matching Go backend structure."""
|
|
2129
|
+
|
|
2130
|
+
name: str
|
|
2131
|
+
key: str
|
|
2132
|
+
type: Any
|
|
2133
|
+
auth_types: List[Any]
|
|
2134
|
+
status: Any
|
|
2135
|
+
description: Optional[str] = None
|
|
2136
|
+
provider_name: Optional[str] = None
|
|
2137
|
+
documentation_url: Optional[str] = None
|
|
2138
|
+
openapi_documentation_url: Optional[str] = None
|
|
2139
|
+
llms_txt_url: Optional[str] = None
|
|
2140
|
+
healthcheck_url: Optional[str] = None
|
|
2141
|
+
auth_url: Optional[str] = None
|
|
2142
|
+
token_url: Optional[str] = None
|
|
2143
|
+
client_id: Optional[str] = None
|
|
2144
|
+
client_secret: Optional[str] = None
|
|
2145
|
+
available_scopes: List[str] = None
|
|
2146
|
+
optional_scopes: List[str] = None
|
|
2147
|
+
scope_separator: Optional[str] = None
|
|
2148
|
+
api_version: Optional[str] = None
|
|
2149
|
+
api_version_description: Optional[str] = None
|
|
2150
|
+
credential_schema: Any = None
|
|
2151
|
+
ui_config: Optional["UIConfig"] = None
|
|
2152
|
+
codegen_details: Optional[CodegenDetails] = None
|
|
2153
|
+
analysis_details: Optional[AnalysisDetails] = None
|
|
2154
|
+
segment_config: Optional["SegmentConfig"] = None
|
|
2155
|
+
dataset_resource_discovery_config: Optional["DatasetResourceDiscoveryConfig"] = None
|
|
2156
|
+
expiry_config: Optional["ExpiryConfig"] = None
|
|
2157
|
+
provider_credentials: Any = None
|
|
2158
|
+
default_resource_attach_type: Optional[str] = None
|
|
2159
|
+
|
|
2160
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2161
|
+
"""Convert to dict format expected by backend."""
|
|
2162
|
+
result = {}
|
|
2163
|
+
result["name"] = self.name
|
|
2164
|
+
result["key"] = self.key
|
|
2165
|
+
result["type"] = self.type
|
|
2166
|
+
result["auth_types"] = self.auth_types
|
|
2167
|
+
result["status"] = self.status
|
|
2168
|
+
if self.description is not None:
|
|
2169
|
+
result["description"] = self.description
|
|
2170
|
+
if self.provider_name is not None:
|
|
2171
|
+
result["provider_name"] = self.provider_name
|
|
2172
|
+
if self.documentation_url is not None:
|
|
2173
|
+
result["documentation_url"] = self.documentation_url
|
|
2174
|
+
if self.openapi_documentation_url is not None:
|
|
2175
|
+
result["openapi_documentation_url"] = self.openapi_documentation_url
|
|
2176
|
+
if self.llms_txt_url is not None:
|
|
2177
|
+
result["llms_txt_url"] = self.llms_txt_url
|
|
2178
|
+
if self.healthcheck_url is not None:
|
|
2179
|
+
result["healthcheck_url"] = self.healthcheck_url
|
|
2180
|
+
if self.auth_url is not None:
|
|
2181
|
+
result["auth_url"] = self.auth_url
|
|
2182
|
+
if self.token_url is not None:
|
|
2183
|
+
result["token_url"] = self.token_url
|
|
2184
|
+
if self.client_id is not None:
|
|
2185
|
+
result["client_id"] = self.client_id
|
|
2186
|
+
if self.client_secret is not None:
|
|
2187
|
+
result["client_secret"] = self.client_secret
|
|
2188
|
+
if self.available_scopes is not None:
|
|
2189
|
+
result["available_scopes"] = self.available_scopes
|
|
2190
|
+
if self.optional_scopes is not None:
|
|
2191
|
+
result["optional_scopes"] = self.optional_scopes
|
|
2192
|
+
if self.scope_separator is not None:
|
|
2193
|
+
result["scope_separator"] = self.scope_separator
|
|
2194
|
+
if self.api_version is not None:
|
|
2195
|
+
result["api_version"] = self.api_version
|
|
2196
|
+
if self.api_version_description is not None:
|
|
2197
|
+
result["api_version_description"] = self.api_version_description
|
|
2198
|
+
if self.credential_schema is not None:
|
|
2199
|
+
result["credential_schema"] = self.credential_schema
|
|
2200
|
+
if self.ui_config is not None:
|
|
2201
|
+
result["ui_config"] = self.ui_config
|
|
2202
|
+
if self.codegen_details is not None:
|
|
2203
|
+
result["codegen_details"] = self.codegen_details
|
|
2204
|
+
if self.analysis_details is not None:
|
|
2205
|
+
result["analysis_details"] = self.analysis_details
|
|
2206
|
+
if self.segment_config is not None:
|
|
2207
|
+
result["segment_config"] = self.segment_config
|
|
2208
|
+
if self.dataset_resource_discovery_config is not None:
|
|
2209
|
+
result["dataset_resource_discovery_config"] = (
|
|
2210
|
+
self.dataset_resource_discovery_config
|
|
2211
|
+
)
|
|
2212
|
+
if self.expiry_config is not None:
|
|
2213
|
+
result["expiry_config"] = self.expiry_config
|
|
2214
|
+
if self.provider_credentials is not None:
|
|
2215
|
+
result["provider_credentials"] = self.provider_credentials
|
|
2216
|
+
if self.default_resource_attach_type is not None:
|
|
2217
|
+
result["default_resource_attach_type"] = self.default_resource_attach_type
|
|
2218
|
+
return result
|
|
2219
|
+
|
|
2220
|
+
|
|
2221
|
+
@dataclass
|
|
2222
|
+
class IntegrationConfig:
|
|
2223
|
+
"""IntegrationConfig matching Go backend structure."""
|
|
2224
|
+
|
|
2225
|
+
definition: "IntegrationDefinition"
|
|
2226
|
+
source: str
|
|
2227
|
+
file_path: str = None
|
|
2228
|
+
|
|
2229
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2230
|
+
"""Convert to dict format expected by backend."""
|
|
2231
|
+
result = {}
|
|
2232
|
+
result["definition"] = self.definition
|
|
2233
|
+
result["source"] = self.source
|
|
2234
|
+
if self.file_path is not None:
|
|
2235
|
+
result["file_path"] = self.file_path
|
|
2236
|
+
return result
|
|
2237
|
+
|
|
2238
|
+
|
|
2239
|
+
@dataclass
|
|
2240
|
+
class PythonIntegrationInstance:
|
|
2241
|
+
"""PythonIntegrationInstance matching Go backend structure."""
|
|
2242
|
+
|
|
2243
|
+
config: IntegrationConfig
|
|
2244
|
+
credentials: Any
|
|
2245
|
+
methods: List[str] = None
|
|
2246
|
+
|
|
2247
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2248
|
+
"""Convert to dict format expected by backend."""
|
|
2249
|
+
result = {}
|
|
2250
|
+
result["config"] = self.config
|
|
2251
|
+
result["credentials"] = self.credentials
|
|
2252
|
+
if self.methods is not None:
|
|
2253
|
+
result["methods"] = self.methods
|
|
2254
|
+
return result
|
|
2255
|
+
|
|
2256
|
+
|
|
2257
|
+
@dataclass
|
|
2258
|
+
class IntegrationDiscovery:
|
|
2259
|
+
"""IntegrationDiscovery matching Go backend structure."""
|
|
2260
|
+
|
|
2261
|
+
config: IntegrationConfig
|
|
2262
|
+
file_path: str
|
|
2263
|
+
source_code: str
|
|
2264
|
+
instance: Optional["PythonIntegrationInstance"] = None
|
|
2265
|
+
|
|
2266
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2267
|
+
"""Convert to dict format expected by backend."""
|
|
2268
|
+
result = {}
|
|
2269
|
+
result["config"] = self.config
|
|
2270
|
+
if self.instance is not None:
|
|
2271
|
+
result["instance"] = self.instance
|
|
2272
|
+
result["file_path"] = self.file_path
|
|
2273
|
+
result["source_code"] = self.source_code
|
|
2274
|
+
return result
|
|
2275
|
+
|
|
2276
|
+
|
|
2277
|
+
@dataclass
|
|
2278
|
+
class UpsertIntegrationRequest:
|
|
2279
|
+
"""UpsertIntegrationRequest matching Go backend structure."""
|
|
2280
|
+
|
|
2281
|
+
integration: "IntegrationDefinition"
|
|
2282
|
+
source: str
|
|
2283
|
+
|
|
2284
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2285
|
+
"""Convert to dict format expected by backend."""
|
|
2286
|
+
result = {}
|
|
2287
|
+
result["integration"] = self.integration
|
|
2288
|
+
result["source"] = self.source
|
|
2289
|
+
return result
|
|
2290
|
+
|
|
2291
|
+
|
|
2292
|
+
@dataclass
|
|
2293
|
+
class UpsertIntegrationResponse:
|
|
2294
|
+
"""UpsertIntegrationResponse matching Go backend structure."""
|
|
2295
|
+
|
|
2296
|
+
integration_id: str
|
|
2297
|
+
status: str
|
|
2298
|
+
|
|
2299
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2300
|
+
"""Convert to dict format expected by backend."""
|
|
2301
|
+
result = {}
|
|
2302
|
+
result["integration_id"] = self.integration_id
|
|
2303
|
+
result["status"] = self.status
|
|
2304
|
+
return result
|
|
2305
|
+
|
|
2306
|
+
|
|
2307
|
+
@dataclass
|
|
2308
|
+
class ListIntegrationsResponse:
|
|
2309
|
+
"""ListIntegrationsResponse matching Go backend structure."""
|
|
2310
|
+
|
|
2311
|
+
integrations: List["IntegrationDefinition"]
|
|
2312
|
+
|
|
2313
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2314
|
+
"""Convert to dict format expected by backend."""
|
|
2315
|
+
result = {}
|
|
2316
|
+
result["integrations"] = self.integrations
|
|
2317
|
+
return result
|
|
2318
|
+
|
|
2319
|
+
|
|
2320
|
+
@dataclass
|
|
2321
|
+
class ExportIntegrationsResponse:
|
|
2322
|
+
"""ExportIntegrationsResponse matching Go backend structure."""
|
|
2323
|
+
|
|
2324
|
+
integrations: Any
|
|
2325
|
+
|
|
2326
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
2327
|
+
"""Convert to dict format expected by backend."""
|
|
2328
|
+
result = {}
|
|
2329
|
+
result["integrations"] = self.integrations
|
|
2330
|
+
return result
|
|
2331
|
+
|
|
2332
|
+
|
|
2333
|
+
# Auto-generated __all__ list for import *
|
|
2334
|
+
__all__ = [
|
|
2335
|
+
"ParameterType",
|
|
2336
|
+
"ParameterHydrationBehaviour",
|
|
2337
|
+
"OutputVisibility",
|
|
2338
|
+
"OutputContentType",
|
|
2339
|
+
"HandlerType",
|
|
2340
|
+
"ExecutionModeType",
|
|
2341
|
+
"LlmModel",
|
|
2342
|
+
"OutputBehaviorType",
|
|
2343
|
+
"CredentialSource",
|
|
2344
|
+
"SensitivityLevel",
|
|
2345
|
+
"JSONSchemaType",
|
|
2346
|
+
"InvocationEventType",
|
|
2347
|
+
"Status",
|
|
2348
|
+
"Error",
|
|
2349
|
+
"DatasetType",
|
|
2350
|
+
"IntegrationType",
|
|
2351
|
+
"AuthType",
|
|
2352
|
+
"IntegrationStatus",
|
|
2353
|
+
"SegmentSelectionType",
|
|
2354
|
+
"ExpiryType",
|
|
2355
|
+
"ResourceType",
|
|
2356
|
+
"ResourceState",
|
|
2357
|
+
"ResourceRelationshipType",
|
|
2358
|
+
"ResourceAttachType",
|
|
2359
|
+
"Bot",
|
|
2360
|
+
"ParameterDefinition",
|
|
2361
|
+
"ParameterValueSource",
|
|
2362
|
+
"ParameterValueSourceHandler",
|
|
2363
|
+
"ParameterInterpreter",
|
|
2364
|
+
"AgentDiscovery",
|
|
2365
|
+
"ExecutionModeConfig",
|
|
2366
|
+
"UpsertBotRequest",
|
|
2367
|
+
"BotsResponse",
|
|
2368
|
+
"StepsResponse",
|
|
2369
|
+
"ServiceDefinition",
|
|
2370
|
+
"ActionDefinition",
|
|
2371
|
+
"ResultSchema",
|
|
2372
|
+
"PropertySchema",
|
|
2373
|
+
"IntegrationSchema",
|
|
2374
|
+
"CodegenDetails",
|
|
2375
|
+
"AnalysisDetails",
|
|
2376
|
+
"CredentialSchema",
|
|
2377
|
+
"ExportActionsResponse",
|
|
2378
|
+
"ConditionDefinition",
|
|
2379
|
+
"TempCondition",
|
|
2380
|
+
"StepWithHandlers",
|
|
2381
|
+
"ResultHandler",
|
|
2382
|
+
"JSONSchemaProperty",
|
|
2383
|
+
"JSONSchema",
|
|
2384
|
+
"Tool",
|
|
2385
|
+
"Message",
|
|
2386
|
+
"SystemParameters",
|
|
2387
|
+
"Result",
|
|
2388
|
+
"APIStep",
|
|
2389
|
+
"APIParameterValueSource",
|
|
2390
|
+
"APIParameterValueSourceHandler",
|
|
2391
|
+
"APIParameterInterpreter",
|
|
2392
|
+
"APIExecutionMode",
|
|
2393
|
+
"APIConditionDefinition",
|
|
2394
|
+
"APITool",
|
|
2395
|
+
"APIResultHandler",
|
|
2396
|
+
"APIParameterDefinition",
|
|
2397
|
+
"APIStepWithHandlers",
|
|
2398
|
+
"Dataset",
|
|
2399
|
+
"BotResource",
|
|
2400
|
+
"UIConfigIcon",
|
|
2401
|
+
"UIConfig",
|
|
2402
|
+
"ErrorHandlingConfig",
|
|
2403
|
+
"SegmentLevel",
|
|
2404
|
+
"SegmentConfig",
|
|
2405
|
+
"ResourceTypeConfig",
|
|
2406
|
+
"DatasetResourceDiscoveryConfig",
|
|
2407
|
+
"ExpiryConfig",
|
|
2408
|
+
"SegmentOption",
|
|
2409
|
+
"IntegrationDefinition",
|
|
2410
|
+
"IntegrationConfig",
|
|
2411
|
+
"PythonIntegrationInstance",
|
|
2412
|
+
"IntegrationDiscovery",
|
|
2413
|
+
"UpsertIntegrationRequest",
|
|
2414
|
+
"UpsertIntegrationResponse",
|
|
2415
|
+
"ListIntegrationsResponse",
|
|
2416
|
+
"ExportIntegrationsResponse",
|
|
2417
|
+
"Memory",
|
|
2418
|
+
"Resource",
|
|
2419
|
+
]
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
# Helper functions for creating bot definitions
|
|
2423
|
+
def create_step(
|
|
2424
|
+
key: str,
|
|
2425
|
+
action_type: str,
|
|
2426
|
+
parameters: Dict[str, Any] = None,
|
|
2427
|
+
depends_on: List[str] = None,
|
|
2428
|
+
**kwargs,
|
|
2429
|
+
) -> Dict[str, Any]:
|
|
2430
|
+
"""Create a step definition dictionary."""
|
|
2431
|
+
step = {
|
|
2432
|
+
"key": key,
|
|
2433
|
+
"action_type": action_type,
|
|
2434
|
+
"parameters": parameters or {},
|
|
2435
|
+
"output_content_type": kwargs.get("output_content_type", "text"),
|
|
2436
|
+
"user_output_visibility": kwargs.get("user_output_visibility", "visible"),
|
|
2437
|
+
"bot_output_visibility": kwargs.get("bot_output_visibility", "hidden"),
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2440
|
+
# Add optional fields if provided
|
|
2441
|
+
for field in [
|
|
2442
|
+
"history_content_type",
|
|
2443
|
+
"ui_content_type",
|
|
2444
|
+
"running_message",
|
|
2445
|
+
"finished_message",
|
|
2446
|
+
]:
|
|
2447
|
+
if field in kwargs:
|
|
2448
|
+
step[field] = kwargs[field]
|
|
2449
|
+
|
|
2450
|
+
return {
|
|
2451
|
+
"step": step,
|
|
2452
|
+
"depends_on": depends_on,
|
|
2453
|
+
"result_handlers": [],
|
|
2454
|
+
"output_channels": [],
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
def create_result_handler(
|
|
2459
|
+
condition: Dict[str, Any],
|
|
2460
|
+
action_type: str = None,
|
|
2461
|
+
parameters: Dict[str, Any] = None,
|
|
2462
|
+
steps: List[Dict[str, Any]] = None,
|
|
2463
|
+
**kwargs,
|
|
2464
|
+
) -> Dict[str, Any]:
|
|
2465
|
+
"""Create a result handler definition dictionary."""
|
|
2466
|
+
handler = {
|
|
2467
|
+
"type": kwargs.get("type", "final"),
|
|
2468
|
+
"if_conditions": condition,
|
|
2469
|
+
"output_content_type": kwargs.get("output_content_type", "text"),
|
|
2470
|
+
"steps": steps or [],
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
# Add optional fields
|
|
2474
|
+
for field in ["history_content_type", "ui_content_type"]:
|
|
2475
|
+
if field in kwargs:
|
|
2476
|
+
handler[field] = kwargs[field]
|
|
2477
|
+
|
|
2478
|
+
# If action_type is provided, create a step for it
|
|
2479
|
+
if action_type:
|
|
2480
|
+
step = {
|
|
2481
|
+
"key": f"handler_step_{len(handler['steps'])}",
|
|
2482
|
+
"action_type": action_type,
|
|
2483
|
+
"parameters": parameters or {},
|
|
2484
|
+
"output_content_type": "text",
|
|
2485
|
+
"user_output_visibility": "visible",
|
|
2486
|
+
"bot_output_visibility": "hidden",
|
|
2487
|
+
}
|
|
2488
|
+
handler["steps"].append(step)
|
|
2489
|
+
|
|
2490
|
+
return handler
|
|
2491
|
+
|
|
2492
|
+
|
|
2493
|
+
def create_bot(
|
|
2494
|
+
name: str, description: str = "", visibility: str = "private", **kwargs
|
|
2495
|
+
) -> Dict[str, Any]:
|
|
2496
|
+
"""Create a bot definition dictionary."""
|
|
2497
|
+
return {
|
|
2498
|
+
"Name": name,
|
|
2499
|
+
"Description": description,
|
|
2500
|
+
"Visibility": visibility,
|
|
2501
|
+
"RunningMessage": {
|
|
2502
|
+
"String": kwargs.get("running_message", ""),
|
|
2503
|
+
"Valid": bool(kwargs.get("running_message")),
|
|
2504
|
+
},
|
|
2505
|
+
"FinishedMessage": {
|
|
2506
|
+
"String": kwargs.get("finished_message", ""),
|
|
2507
|
+
"Valid": bool(kwargs.get("finished_message")),
|
|
2508
|
+
},
|
|
2509
|
+
"Persona": {
|
|
2510
|
+
"String": kwargs.get("persona", ""),
|
|
2511
|
+
"Valid": bool(kwargs.get("persona")),
|
|
2512
|
+
},
|
|
2513
|
+
"Source": "python",
|
|
2514
|
+
}
|