agent-lab-sdk 0.1.44__py3-none-any.whl → 0.1.46__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 agent-lab-sdk might be problematic. Click here for more details.
- agent_lab_sdk/schema/__init__.py +5 -3
- agent_lab_sdk/schema/input_types.py +74 -27
- {agent_lab_sdk-0.1.44.dist-info → agent_lab_sdk-0.1.46.dist-info}/METADATA +69 -18
- {agent_lab_sdk-0.1.44.dist-info → agent_lab_sdk-0.1.46.dist-info}/RECORD +7 -7
- {agent_lab_sdk-0.1.44.dist-info → agent_lab_sdk-0.1.46.dist-info}/WHEEL +0 -0
- {agent_lab_sdk-0.1.44.dist-info → agent_lab_sdk-0.1.46.dist-info}/licenses/LICENSE +0 -0
- {agent_lab_sdk-0.1.44.dist-info → agent_lab_sdk-0.1.46.dist-info}/top_level.txt +0 -0
agent_lab_sdk/schema/__init__.py
CHANGED
|
@@ -10,13 +10,14 @@ from .input_types import (
|
|
|
10
10
|
SwitchInput,
|
|
11
11
|
FileInput,
|
|
12
12
|
FilesInput,
|
|
13
|
-
SelectOption
|
|
13
|
+
SelectOption,
|
|
14
|
+
Visibility
|
|
14
15
|
)
|
|
15
16
|
|
|
16
17
|
__all__ = [
|
|
17
18
|
"LogMessage",
|
|
18
19
|
"MainInput",
|
|
19
|
-
"StringInput",
|
|
20
|
+
"StringInput",
|
|
20
21
|
"StringArrayInput",
|
|
21
22
|
"StringArrayInputInline",
|
|
22
23
|
"NumberInput",
|
|
@@ -25,5 +26,6 @@ __all__ = [
|
|
|
25
26
|
"SwitchInput",
|
|
26
27
|
"FileInput",
|
|
27
28
|
"FilesInput",
|
|
28
|
-
"SelectOption"
|
|
29
|
+
"SelectOption",
|
|
30
|
+
"Visibility"
|
|
29
31
|
]
|
|
@@ -1,35 +1,54 @@
|
|
|
1
|
-
from typing import List, Optional, Any
|
|
1
|
+
from typing import List, Optional, Any, Literal
|
|
2
|
+
from enum import Enum
|
|
2
3
|
from pydantic import BaseModel
|
|
3
4
|
from pydantic.json_schema import WithJsonSchema
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
class Visibility(str, Enum):
|
|
8
|
+
"""
|
|
9
|
+
Enum representing visibility states for input fields.
|
|
10
|
+
|
|
11
|
+
Attributes:
|
|
12
|
+
ALWAYS: Field is always visible
|
|
13
|
+
START: Field is visible only at start
|
|
14
|
+
AFTER_START: Field is visible after start
|
|
15
|
+
"""
|
|
16
|
+
ALWAYS = "always"
|
|
17
|
+
START = "start"
|
|
18
|
+
AFTER_START = "after_start"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def MainInput(placeholder: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
7
22
|
"""
|
|
8
23
|
Factory function for creating a main input type with optional placeholder.
|
|
9
|
-
|
|
24
|
+
|
|
10
25
|
Args:
|
|
11
26
|
placeholder: Optional placeholder text for the input field
|
|
12
|
-
|
|
27
|
+
visibility: Visibility state of the field (default: "always")
|
|
28
|
+
|
|
13
29
|
Returns:
|
|
14
30
|
Type annotation for main input field
|
|
15
31
|
"""
|
|
16
32
|
return WithJsonSchema({
|
|
17
33
|
"type": "main-input",
|
|
18
34
|
"placeholder": placeholder,
|
|
35
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
19
36
|
})
|
|
20
37
|
|
|
21
38
|
|
|
22
|
-
def StringInput(default: str | None = None, title: str | None = None, description: str | None = None,
|
|
39
|
+
def StringInput(default: str | None = None, title: str | None = None, description: str | None = None,
|
|
40
|
+
hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
23
41
|
"""
|
|
24
42
|
Factory function for creating a string input type.
|
|
25
|
-
|
|
43
|
+
|
|
26
44
|
Args:
|
|
27
45
|
default: Default value for the string input
|
|
28
46
|
title: Title for the string input
|
|
29
47
|
description: Description text for the string input
|
|
30
48
|
hidden: Whether the input should be hidden in the UI
|
|
31
49
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
32
|
-
|
|
50
|
+
visibility: Visibility state of the field (default: "always")
|
|
51
|
+
|
|
33
52
|
Returns:
|
|
34
53
|
Type annotation for string input field
|
|
35
54
|
"""
|
|
@@ -40,13 +59,15 @@ def StringInput(default: str | None = None, title: str | None = None, descriptio
|
|
|
40
59
|
"description": description,
|
|
41
60
|
"hidden": hidden,
|
|
42
61
|
"depends": depends,
|
|
62
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
43
63
|
})
|
|
44
64
|
|
|
45
65
|
|
|
46
|
-
def StringArrayInput(placeholder: str | None = None, title: str | None = None, description: str | None = None,
|
|
66
|
+
def StringArrayInput(placeholder: str | None = None, title: str | None = None, description: str | None = None,
|
|
67
|
+
group: str | None = None, hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
47
68
|
"""
|
|
48
69
|
Factory function for creating a string array input type.
|
|
49
|
-
|
|
70
|
+
|
|
50
71
|
Args:
|
|
51
72
|
placeholder: Placeholder text for the input field
|
|
52
73
|
title: Title for the string array input
|
|
@@ -54,7 +75,8 @@ def StringArrayInput(placeholder: str | None = None, title: str | None = None, d
|
|
|
54
75
|
group: Group name for organizing inputs in the UI
|
|
55
76
|
hidden: Whether the input should be hidden in the UI
|
|
56
77
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
57
|
-
|
|
78
|
+
visibility: Visibility state of the field (default: "always")
|
|
79
|
+
|
|
58
80
|
Returns:
|
|
59
81
|
Type annotation for string array input field
|
|
60
82
|
"""
|
|
@@ -66,11 +88,12 @@ def StringArrayInput(placeholder: str | None = None, title: str | None = None, d
|
|
|
66
88
|
"group": group,
|
|
67
89
|
"hidden": hidden,
|
|
68
90
|
"depends": depends,
|
|
91
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
69
92
|
})
|
|
70
93
|
|
|
71
94
|
|
|
72
95
|
def StringArrayInputInline(placeholder: str | None = None, title: str | None = None, description: str | None = None,
|
|
73
|
-
group: str | None = None, hidden: bool | None = False, depends: str | None = None) -> type:
|
|
96
|
+
group: str | None = None, hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
74
97
|
"""
|
|
75
98
|
Factory function for creating a string array input inline type.
|
|
76
99
|
|
|
@@ -81,6 +104,7 @@ def StringArrayInputInline(placeholder: str | None = None, title: str | None = N
|
|
|
81
104
|
group: Group name for organizing inputs in the UI
|
|
82
105
|
hidden: Whether the input should be hidden in the UI
|
|
83
106
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
107
|
+
visibility: Visibility state of the field (default: "always")
|
|
84
108
|
|
|
85
109
|
Returns:
|
|
86
110
|
Type annotation for string array input field
|
|
@@ -93,20 +117,23 @@ def StringArrayInputInline(placeholder: str | None = None, title: str | None = N
|
|
|
93
117
|
"group": group,
|
|
94
118
|
"hidden": hidden,
|
|
95
119
|
"depends": depends,
|
|
120
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
96
121
|
})
|
|
97
122
|
|
|
98
123
|
|
|
99
|
-
def NumberInput(default: float | None = None, title: str | None = None, description: str | None = None,
|
|
124
|
+
def NumberInput(default: float | None = None, title: str | None = None, description: str | None = None,
|
|
125
|
+
hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
100
126
|
"""
|
|
101
127
|
Factory function for creating a number input type.
|
|
102
|
-
|
|
128
|
+
|
|
103
129
|
Args:
|
|
104
130
|
default: Default value for the number input
|
|
105
131
|
title: Title for the number input
|
|
106
132
|
description: Description text for the number input
|
|
107
133
|
hidden: Whether the input should be hidden in the UI
|
|
108
134
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
109
|
-
|
|
135
|
+
visibility: Visibility state of the field (default: "always")
|
|
136
|
+
|
|
110
137
|
Returns:
|
|
111
138
|
Type annotation for number input field
|
|
112
139
|
"""
|
|
@@ -117,6 +144,7 @@ def NumberInput(default: float | None = None, title: str | None = None, descript
|
|
|
117
144
|
"description": description,
|
|
118
145
|
"hidden": hidden,
|
|
119
146
|
"depends": depends,
|
|
147
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
120
148
|
})
|
|
121
149
|
|
|
122
150
|
|
|
@@ -134,10 +162,11 @@ class SelectOption(BaseModel):
|
|
|
134
162
|
description: Optional[str] = None
|
|
135
163
|
|
|
136
164
|
|
|
137
|
-
def SelectInput(items: List[Any] = [], title: str | None = None, group: str | None = None, default: str | None = None,
|
|
165
|
+
def SelectInput(items: List[Any] = [], title: str | None = None, group: str | None = None, default: str | None = None,
|
|
166
|
+
hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
138
167
|
"""
|
|
139
168
|
Factory function for creating a select input type.
|
|
140
|
-
|
|
169
|
+
|
|
141
170
|
Args:
|
|
142
171
|
items: List of SelectOption objects or dictionaries
|
|
143
172
|
title: Title for the select input
|
|
@@ -145,7 +174,8 @@ def SelectInput(items: List[Any] = [], title: str | None = None, group: str | No
|
|
|
145
174
|
default: Default selected value
|
|
146
175
|
hidden: Whether the input should be hidden in the UI
|
|
147
176
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
148
|
-
|
|
177
|
+
visibility: Visibility state of the field (default: "always")
|
|
178
|
+
|
|
149
179
|
Returns:
|
|
150
180
|
Type annotation for select input field
|
|
151
181
|
"""
|
|
@@ -157,13 +187,15 @@ def SelectInput(items: List[Any] = [], title: str | None = None, group: str | No
|
|
|
157
187
|
"default": default,
|
|
158
188
|
"hidden": hidden,
|
|
159
189
|
"depends": depends,
|
|
190
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
160
191
|
})
|
|
161
192
|
|
|
162
193
|
|
|
163
|
-
def CheckboxInput(title: str | None = None, group: str | None = None, description: str | None = None,
|
|
194
|
+
def CheckboxInput(title: str | None = None, group: str | None = None, description: str | None = None,
|
|
195
|
+
default: bool | None = False, hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
164
196
|
"""
|
|
165
197
|
Factory function for creating a checkbox input type.
|
|
166
|
-
|
|
198
|
+
|
|
167
199
|
Args:
|
|
168
200
|
title: Title for the checkbox
|
|
169
201
|
group: Group name for organizing inputs in the UI
|
|
@@ -171,7 +203,8 @@ def CheckboxInput(title: str | None = None, group: str | None = None, descriptio
|
|
|
171
203
|
default: Default checked state
|
|
172
204
|
hidden: Whether the input should be hidden in the UI
|
|
173
205
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
174
|
-
|
|
206
|
+
visibility: Visibility state of the field (default: "always")
|
|
207
|
+
|
|
175
208
|
Returns:
|
|
176
209
|
Type annotation for checkbox input field
|
|
177
210
|
"""
|
|
@@ -183,11 +216,12 @@ def CheckboxInput(title: str | None = None, group: str | None = None, descriptio
|
|
|
183
216
|
"default": default,
|
|
184
217
|
"hidden": hidden,
|
|
185
218
|
"depends": depends,
|
|
219
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
186
220
|
})
|
|
187
221
|
|
|
188
222
|
|
|
189
223
|
def SwitchInput(title: str | None = None, group: str | None = None, description: str | None = None,
|
|
190
|
-
default: bool | None = False, hidden: bool | None = False, depends: str | None = None) -> type:
|
|
224
|
+
default: bool | None = False, hidden: bool | None = False, depends: str | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
191
225
|
"""
|
|
192
226
|
Factory function for creating a switch input type.
|
|
193
227
|
|
|
@@ -198,6 +232,7 @@ def SwitchInput(title: str | None = None, group: str | None = None, description:
|
|
|
198
232
|
default: Default checked state
|
|
199
233
|
hidden: Whether the input should be hidden in the UI
|
|
200
234
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
235
|
+
visibility: Visibility state of the field (default: "always")
|
|
201
236
|
|
|
202
237
|
Returns:
|
|
203
238
|
Type annotation for switch input field
|
|
@@ -210,20 +245,25 @@ def SwitchInput(title: str | None = None, group: str | None = None, description:
|
|
|
210
245
|
"default": default,
|
|
211
246
|
"hidden": hidden,
|
|
212
247
|
"depends": depends,
|
|
248
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
213
249
|
})
|
|
214
250
|
|
|
215
251
|
|
|
216
|
-
def FileInput(title: str | None = None, file_extensions: str | None = None, group: str | None = None,
|
|
252
|
+
def FileInput(title: str | None = None, file_extensions: str | None = None, group: str | None = None,
|
|
253
|
+
hidden: bool | None = False, depends: str | None = None, view: Literal["button", "dropzone"] | None = None,
|
|
254
|
+
visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
217
255
|
"""
|
|
218
256
|
Factory function for creating a single file input type.
|
|
219
|
-
|
|
257
|
+
|
|
220
258
|
Args:
|
|
221
259
|
title: Title for the file input
|
|
222
260
|
file_extensions: Comma-separated list of allowed file extensions (e.g., ".pdf,.txt")
|
|
223
261
|
group: Group name for organizing inputs in the UI
|
|
224
262
|
hidden: Whether the input should be hidden in the UI
|
|
225
263
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
226
|
-
|
|
264
|
+
view: View mode for the file input ("button" or "dropzone")
|
|
265
|
+
visibility: Visibility state of the field (default: "always")
|
|
266
|
+
|
|
227
267
|
Returns:
|
|
228
268
|
Type annotation for file input field
|
|
229
269
|
"""
|
|
@@ -234,14 +274,17 @@ def FileInput(title: str | None = None, file_extensions: str | None = None, grou
|
|
|
234
274
|
"group": group,
|
|
235
275
|
"hidden": hidden,
|
|
236
276
|
"depends": depends,
|
|
277
|
+
"view": view,
|
|
278
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
237
279
|
})
|
|
238
280
|
|
|
239
281
|
|
|
240
282
|
def FilesInput(title: str | None = None, file_extensions: str | None = None, group: str | None = None,
|
|
241
|
-
hidden: bool | None = False, depends: str | None = None, limit: int | None = 10
|
|
283
|
+
hidden: bool | None = False, depends: str | None = None, limit: int | None = 10,
|
|
284
|
+
view: Literal["button", "dropzone"] | None = None, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
242
285
|
"""
|
|
243
286
|
Factory function for creating a multiple files input type.
|
|
244
|
-
|
|
287
|
+
|
|
245
288
|
Args:
|
|
246
289
|
title: Title for the files input
|
|
247
290
|
file_extensions: Comma-separated list of allowed file extensions (e.g., ".pdf,.txt")
|
|
@@ -249,6 +292,8 @@ def FilesInput(title: str | None = None, file_extensions: str | None = None, gro
|
|
|
249
292
|
hidden: Whether the input should be hidden in the UI
|
|
250
293
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
251
294
|
limit: Limit count files.
|
|
295
|
+
view: View mode for the files input ("button" or "dropzone")
|
|
296
|
+
visibility: Visibility state of the field (default: "always")
|
|
252
297
|
|
|
253
298
|
Returns:
|
|
254
299
|
Type annotation for files input field
|
|
@@ -261,4 +306,6 @@ def FilesInput(title: str | None = None, file_extensions: str | None = None, gro
|
|
|
261
306
|
"hidden": hidden,
|
|
262
307
|
"depends": depends,
|
|
263
308
|
"limit": limit,
|
|
264
|
-
|
|
309
|
+
"view": view,
|
|
310
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
311
|
+
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-lab-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.46
|
|
4
4
|
Summary: SDK для работы с Agent Lab
|
|
5
5
|
Author-email: Andrew Ohurtsov <andermirik@yandex.com>
|
|
6
6
|
License: Proprietary and Confidential — All Rights Reserved
|
|
@@ -262,7 +262,7 @@ from typing import List, Annotated
|
|
|
262
262
|
from pydantic import BaseModel, Field
|
|
263
263
|
from agent_lab_sdk.schema import (
|
|
264
264
|
MainInput, StringInput, StringArrayInput, NumberInput,
|
|
265
|
-
SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption
|
|
265
|
+
SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption, Visibility
|
|
266
266
|
)
|
|
267
267
|
|
|
268
268
|
class AgentState(BaseModel):
|
|
@@ -273,7 +273,8 @@ class AgentState(BaseModel):
|
|
|
273
273
|
title: Annotated[str, StringInput(
|
|
274
274
|
default="Без названия",
|
|
275
275
|
title="Заголовок",
|
|
276
|
-
description="Название для вашего запроса"
|
|
276
|
+
description="Название для вашего запроса",
|
|
277
|
+
visibility=Visibility.ALWAYS # или visibility="always"
|
|
277
278
|
)]
|
|
278
279
|
|
|
279
280
|
# Массив строк
|
|
@@ -314,31 +315,33 @@ class AgentState(BaseModel):
|
|
|
314
315
|
# Загрузка одного файла
|
|
315
316
|
document: Annotated[str, FileInput(
|
|
316
317
|
title="Документ",
|
|
317
|
-
file_extensions=".pdf,.docx,.txt"
|
|
318
|
+
file_extensions=".pdf,.docx,.txt",
|
|
319
|
+
view="button" # или "dropzone" для drag-and-drop
|
|
318
320
|
)]
|
|
319
|
-
|
|
321
|
+
|
|
320
322
|
# Загрузка нескольких файлов
|
|
321
323
|
attachments: Annotated[List[str], FilesInput(
|
|
322
324
|
title="Прикрепленные файлы",
|
|
323
325
|
file_extensions=".pdf,.csv,.xlsx",
|
|
324
|
-
group="Файлы"
|
|
326
|
+
group="Файлы",
|
|
327
|
+
view="dropzone" # область перетаскивания файлов
|
|
325
328
|
)]
|
|
326
329
|
```
|
|
327
330
|
|
|
328
331
|
#### Доступные фабричные функции
|
|
329
332
|
|
|
330
|
-
| Тип | Описание | Основные параметры
|
|
331
|
-
|
|
332
|
-
| `MainInput` | Основное поле ввода | `placeholder`
|
|
333
|
-
| `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden`, `depends`
|
|
334
|
-
| `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`
|
|
335
|
-
| `StringArrayInputInline` | Массив строк в одной строке ввода | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`
|
|
336
|
-
| `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden`, `depends`
|
|
337
|
-
| `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden`, `depends`
|
|
338
|
-
| `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden`, `depends`
|
|
339
|
-
| `SwitchInput` | Switch | `title`, `group`, `description`, `default`, `hidden`, `depends`
|
|
340
|
-
| `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden`, `depends`
|
|
341
|
-
| `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden`, `depends`, `limit`
|
|
333
|
+
| Тип | Описание | Основные параметры |
|
|
334
|
+
|--------------------------|-----------------------------------|--------------------------------------------------------------------------------------------|
|
|
335
|
+
| `MainInput` | Основное поле ввода | `placeholder`, `visibility` |
|
|
336
|
+
| `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
337
|
+
| `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
338
|
+
| `StringArrayInputInline` | Массив строк в одной строке ввода | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
339
|
+
| `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
340
|
+
| `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden`, `depends`, `visibility` |
|
|
341
|
+
| `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
342
|
+
| `SwitchInput` | Switch | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
343
|
+
| `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden`, `depends`, `view`, `visibility` |
|
|
344
|
+
| `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden`, `depends`, `limit`, `view`, `visibility` |
|
|
342
345
|
|
|
343
346
|
#### Группировка полей
|
|
344
347
|
|
|
@@ -371,6 +374,54 @@ class TaskConfig(BaseModel):
|
|
|
371
374
|
)]
|
|
372
375
|
```
|
|
373
376
|
|
|
377
|
+
#### Управление видимостью полей
|
|
378
|
+
|
|
379
|
+
Параметр `visibility` контролирует, когда поле отображается в интерфейсе. Доступные значения:
|
|
380
|
+
|
|
381
|
+
```python
|
|
382
|
+
from agent_lab_sdk.schema import Visibility
|
|
383
|
+
|
|
384
|
+
# Enum с тремя значениями:
|
|
385
|
+
Visibility.ALWAYS # "always" - поле всегда доступно для ввода (по умолчанию)
|
|
386
|
+
Visibility.START # "start" - поле доступно для ввода только при старте
|
|
387
|
+
Visibility.AFTER_START # "after_start" - поле доступно для ввода после старта
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**Пример использования:**
|
|
391
|
+
|
|
392
|
+
```python
|
|
393
|
+
class AgentConfig(BaseModel):
|
|
394
|
+
# Всегда доступно для ввода поле
|
|
395
|
+
query: Annotated[str, MainInput(
|
|
396
|
+
placeholder="Введите запрос",
|
|
397
|
+
visibility=Visibility.ALWAYS
|
|
398
|
+
)]
|
|
399
|
+
|
|
400
|
+
# Поле доступно для ввода только при первом запуске
|
|
401
|
+
api_key: Annotated[str, StringInput(
|
|
402
|
+
title="API ключ",
|
|
403
|
+
description="Ключ для доступа к внешнему API",
|
|
404
|
+
visibility=Visibility.START
|
|
405
|
+
)]
|
|
406
|
+
|
|
407
|
+
# Поле появляется после первого сообщения
|
|
408
|
+
session_id: Annotated[str, StringInput(
|
|
409
|
+
title="ID сессии",
|
|
410
|
+
description="Идентификатор текущей сессии",
|
|
411
|
+
visibility=Visibility.AFTER_START,
|
|
412
|
+
hidden=True
|
|
413
|
+
)]
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
Можно также передавать строковые значения напрямую:
|
|
417
|
+
|
|
418
|
+
```python
|
|
419
|
+
title: Annotated[str, StringInput(
|
|
420
|
+
title="Заголовок",
|
|
421
|
+
visibility="always" # эквивалентно Visibility.ALWAYS
|
|
422
|
+
)]
|
|
423
|
+
```
|
|
424
|
+
|
|
374
425
|
### 5.2. LogMessage
|
|
375
426
|
|
|
376
427
|
`LogMessage` — вспомогательное сообщение для потоковой передачи логов из узлов LangGraph / LangChain. Экземпляры создаются как обычные сообщения чата, но получают тип `log`, поэтому фронтенд может отображать их отдельно от ответов модели.
|
|
@@ -9,14 +9,14 @@ agent_lab_sdk/llm/llm.py,sha256=xL6FYyzjx22w_HnGK0ygGJTGr_OEz9EB6JWyYztprg4,2018
|
|
|
9
9
|
agent_lab_sdk/llm/throttled.py,sha256=faccDXiKkmFFfZkVrxFQDHxHutAAivsKDEpYlygfuqU,8019
|
|
10
10
|
agent_lab_sdk/metrics/__init__.py,sha256=G4VSlzKwupPMM4c6vZaF1rnd0KusKarezDMjli9pVFw,57
|
|
11
11
|
agent_lab_sdk/metrics/metrics.py,sha256=_XTT9vMG7T0u_D2pL371wm8GoBU5fodJ45D2RACnBJw,3439
|
|
12
|
-
agent_lab_sdk/schema/__init__.py,sha256=
|
|
13
|
-
agent_lab_sdk/schema/input_types.py,sha256=
|
|
12
|
+
agent_lab_sdk/schema/__init__.py,sha256=cDVmQG5eYd2qO7DtDTt_YCISQyUXjLprUZ6KvKESKtU,554
|
|
13
|
+
agent_lab_sdk/schema/input_types.py,sha256=0Nwm3R8P-PGqOjshXuPiX0HQA73Obdir1kHgaqFlzPA,11952
|
|
14
14
|
agent_lab_sdk/schema/log_message.py,sha256=nadi6lZGRuDSPmfbYs9QPpRJUT9Pfy8Y7pGCvyFF5Mw,638
|
|
15
15
|
agent_lab_sdk/storage/__init__.py,sha256=HAtUoqg3k0irqPMewayadVA9aXJOmYSxRr6a5J1scT0,174
|
|
16
16
|
agent_lab_sdk/storage/storage.py,sha256=ELpt7GRwFD-aWa6ctinfA_QwcvzWLvKS0Wz8FlxVqAs,2075
|
|
17
17
|
agent_lab_sdk/storage/storage_v2.py,sha256=ONseynX59xzWK17dfzxZvnii2rpz3Oo2Zo9Ck-lcGnw,1997
|
|
18
|
-
agent_lab_sdk-0.1.
|
|
19
|
-
agent_lab_sdk-0.1.
|
|
20
|
-
agent_lab_sdk-0.1.
|
|
21
|
-
agent_lab_sdk-0.1.
|
|
22
|
-
agent_lab_sdk-0.1.
|
|
18
|
+
agent_lab_sdk-0.1.46.dist-info/licenses/LICENSE,sha256=_TRXHkF3S9ilWBPdZcHLI_S-PRjK0L_SeOb2pcPAdV4,417
|
|
19
|
+
agent_lab_sdk-0.1.46.dist-info/METADATA,sha256=dHOVuTzjCB5mBJrju8rrZzBGDV265kxFgPpX0GDZ3eQ,23074
|
|
20
|
+
agent_lab_sdk-0.1.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
21
|
+
agent_lab_sdk-0.1.46.dist-info/top_level.txt,sha256=E1efqkJ89KNmPBWdLzdMHeVtH0dYyCo4fhnSb81_15I,14
|
|
22
|
+
agent_lab_sdk-0.1.46.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|