agent-lab-sdk 0.1.44__tar.gz → 0.1.45__tar.gz
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-0.1.44 → agent_lab_sdk-0.1.45}/PKG-INFO +64 -15
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/README.md +63 -14
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/schema/__init__.py +5 -3
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/schema/input_types.py +66 -25
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk.egg-info/PKG-INFO +64 -15
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/pyproject.toml +1 -1
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/LICENSE +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/__init__.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/langgraph/checkpoint/__init__.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/langgraph/checkpoint/agw_saver.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/langgraph/checkpoint/serde.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/llm/__init__.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/llm/agw_token_manager.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/llm/gigachat_token_manager.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/llm/llm.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/llm/throttled.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/metrics/__init__.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/metrics/metrics.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/schema/log_message.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/storage/__init__.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/storage/storage.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/storage/storage_v2.py +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk.egg-info/SOURCES.txt +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk.egg-info/dependency_links.txt +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk.egg-info/requires.txt +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk.egg-info/top_level.txt +0 -0
- {agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-lab-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.45
|
|
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
|
# Массив строк
|
|
@@ -327,18 +328,18 @@ class AgentState(BaseModel):
|
|
|
327
328
|
|
|
328
329
|
#### Доступные фабричные функции
|
|
329
330
|
|
|
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` |
|
|
331
|
+
| Тип | Описание | Основные параметры |
|
|
332
|
+
|--------------------------|-----------------------------------|-----------------------------------------------------------------------------------|
|
|
333
|
+
| `MainInput` | Основное поле ввода | `placeholder`, `visibility` |
|
|
334
|
+
| `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
335
|
+
| `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
336
|
+
| `StringArrayInputInline` | Массив строк в одной строке ввода | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
337
|
+
| `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
338
|
+
| `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden`, `depends`, `visibility` |
|
|
339
|
+
| `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
340
|
+
| `SwitchInput` | Switch | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
341
|
+
| `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden`, `depends`, `visibility` |
|
|
342
|
+
| `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden`, `depends`, `limit`, `visibility` |
|
|
342
343
|
|
|
343
344
|
#### Группировка полей
|
|
344
345
|
|
|
@@ -371,6 +372,54 @@ class TaskConfig(BaseModel):
|
|
|
371
372
|
)]
|
|
372
373
|
```
|
|
373
374
|
|
|
375
|
+
#### Управление видимостью полей
|
|
376
|
+
|
|
377
|
+
Параметр `visibility` контролирует, когда поле отображается в интерфейсе. Доступные значения:
|
|
378
|
+
|
|
379
|
+
```python
|
|
380
|
+
from agent_lab_sdk.schema import Visibility
|
|
381
|
+
|
|
382
|
+
# Enum с тремя значениями:
|
|
383
|
+
Visibility.ALWAYS # "always" - поле всегда доступно для ввода (по умолчанию)
|
|
384
|
+
Visibility.START # "start" - поле доступно для ввода только при старте
|
|
385
|
+
Visibility.AFTER_START # "after_start" - поле доступно для ввода после старта
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**Пример использования:**
|
|
389
|
+
|
|
390
|
+
```python
|
|
391
|
+
class AgentConfig(BaseModel):
|
|
392
|
+
# Всегда доступно для ввода поле
|
|
393
|
+
query: Annotated[str, MainInput(
|
|
394
|
+
placeholder="Введите запрос",
|
|
395
|
+
visibility=Visibility.ALWAYS
|
|
396
|
+
)]
|
|
397
|
+
|
|
398
|
+
# Поле доступно для ввода только при первом запуске
|
|
399
|
+
api_key: Annotated[str, StringInput(
|
|
400
|
+
title="API ключ",
|
|
401
|
+
description="Ключ для доступа к внешнему API",
|
|
402
|
+
visibility=Visibility.START
|
|
403
|
+
)]
|
|
404
|
+
|
|
405
|
+
# Поле появляется после первого сообщения
|
|
406
|
+
session_id: Annotated[str, StringInput(
|
|
407
|
+
title="ID сессии",
|
|
408
|
+
description="Идентификатор текущей сессии",
|
|
409
|
+
visibility=Visibility.AFTER_START,
|
|
410
|
+
hidden=True
|
|
411
|
+
)]
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Можно также передавать строковые значения напрямую:
|
|
415
|
+
|
|
416
|
+
```python
|
|
417
|
+
title: Annotated[str, StringInput(
|
|
418
|
+
title="Заголовок",
|
|
419
|
+
visibility="always" # эквивалентно Visibility.ALWAYS
|
|
420
|
+
)]
|
|
421
|
+
```
|
|
422
|
+
|
|
374
423
|
### 5.2. LogMessage
|
|
375
424
|
|
|
376
425
|
`LogMessage` — вспомогательное сообщение для потоковой передачи логов из узлов LangGraph / LangChain. Экземпляры создаются как обычные сообщения чата, но получают тип `log`, поэтому фронтенд может отображать их отдельно от ответов модели.
|
|
@@ -232,7 +232,7 @@ from typing import List, Annotated
|
|
|
232
232
|
from pydantic import BaseModel, Field
|
|
233
233
|
from agent_lab_sdk.schema import (
|
|
234
234
|
MainInput, StringInput, StringArrayInput, NumberInput,
|
|
235
|
-
SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption
|
|
235
|
+
SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption, Visibility
|
|
236
236
|
)
|
|
237
237
|
|
|
238
238
|
class AgentState(BaseModel):
|
|
@@ -243,7 +243,8 @@ class AgentState(BaseModel):
|
|
|
243
243
|
title: Annotated[str, StringInput(
|
|
244
244
|
default="Без названия",
|
|
245
245
|
title="Заголовок",
|
|
246
|
-
description="Название для вашего запроса"
|
|
246
|
+
description="Название для вашего запроса",
|
|
247
|
+
visibility=Visibility.ALWAYS # или visibility="always"
|
|
247
248
|
)]
|
|
248
249
|
|
|
249
250
|
# Массив строк
|
|
@@ -297,18 +298,18 @@ class AgentState(BaseModel):
|
|
|
297
298
|
|
|
298
299
|
#### Доступные фабричные функции
|
|
299
300
|
|
|
300
|
-
| Тип | Описание | Основные параметры
|
|
301
|
-
|
|
302
|
-
| `MainInput` | Основное поле ввода | `placeholder` |
|
|
303
|
-
| `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden`, `depends` |
|
|
304
|
-
| `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden`, `depends` |
|
|
305
|
-
| `StringArrayInputInline` | Массив строк в одной строке ввода | `placeholder`, `title`, `description`, `group`, `hidden`, `depends` |
|
|
306
|
-
| `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden`, `depends` |
|
|
307
|
-
| `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden`, `depends` |
|
|
308
|
-
| `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden`, `depends` |
|
|
309
|
-
| `SwitchInput` | Switch | `title`, `group`, `description`, `default`, `hidden`, `depends` |
|
|
310
|
-
| `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden`, `depends` |
|
|
311
|
-
| `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden`, `depends`, `limit` |
|
|
301
|
+
| Тип | Описание | Основные параметры |
|
|
302
|
+
|--------------------------|-----------------------------------|-----------------------------------------------------------------------------------|
|
|
303
|
+
| `MainInput` | Основное поле ввода | `placeholder`, `visibility` |
|
|
304
|
+
| `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
305
|
+
| `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
306
|
+
| `StringArrayInputInline` | Массив строк в одной строке ввода | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
307
|
+
| `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
308
|
+
| `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden`, `depends`, `visibility` |
|
|
309
|
+
| `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
310
|
+
| `SwitchInput` | Switch | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
311
|
+
| `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden`, `depends`, `visibility` |
|
|
312
|
+
| `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden`, `depends`, `limit`, `visibility` |
|
|
312
313
|
|
|
313
314
|
#### Группировка полей
|
|
314
315
|
|
|
@@ -341,6 +342,54 @@ class TaskConfig(BaseModel):
|
|
|
341
342
|
)]
|
|
342
343
|
```
|
|
343
344
|
|
|
345
|
+
#### Управление видимостью полей
|
|
346
|
+
|
|
347
|
+
Параметр `visibility` контролирует, когда поле отображается в интерфейсе. Доступные значения:
|
|
348
|
+
|
|
349
|
+
```python
|
|
350
|
+
from agent_lab_sdk.schema import Visibility
|
|
351
|
+
|
|
352
|
+
# Enum с тремя значениями:
|
|
353
|
+
Visibility.ALWAYS # "always" - поле всегда доступно для ввода (по умолчанию)
|
|
354
|
+
Visibility.START # "start" - поле доступно для ввода только при старте
|
|
355
|
+
Visibility.AFTER_START # "after_start" - поле доступно для ввода после старта
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
**Пример использования:**
|
|
359
|
+
|
|
360
|
+
```python
|
|
361
|
+
class AgentConfig(BaseModel):
|
|
362
|
+
# Всегда доступно для ввода поле
|
|
363
|
+
query: Annotated[str, MainInput(
|
|
364
|
+
placeholder="Введите запрос",
|
|
365
|
+
visibility=Visibility.ALWAYS
|
|
366
|
+
)]
|
|
367
|
+
|
|
368
|
+
# Поле доступно для ввода только при первом запуске
|
|
369
|
+
api_key: Annotated[str, StringInput(
|
|
370
|
+
title="API ключ",
|
|
371
|
+
description="Ключ для доступа к внешнему API",
|
|
372
|
+
visibility=Visibility.START
|
|
373
|
+
)]
|
|
374
|
+
|
|
375
|
+
# Поле появляется после первого сообщения
|
|
376
|
+
session_id: Annotated[str, StringInput(
|
|
377
|
+
title="ID сессии",
|
|
378
|
+
description="Идентификатор текущей сессии",
|
|
379
|
+
visibility=Visibility.AFTER_START,
|
|
380
|
+
hidden=True
|
|
381
|
+
)]
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Можно также передавать строковые значения напрямую:
|
|
385
|
+
|
|
386
|
+
```python
|
|
387
|
+
title: Annotated[str, StringInput(
|
|
388
|
+
title="Заголовок",
|
|
389
|
+
visibility="always" # эквивалентно Visibility.ALWAYS
|
|
390
|
+
)]
|
|
391
|
+
```
|
|
392
|
+
|
|
344
393
|
### 5.2. LogMessage
|
|
345
394
|
|
|
346
395
|
`LogMessage` — вспомогательное сообщение для потоковой передачи логов из узлов LangGraph / LangChain. Экземпляры создаются как обычные сообщения чата, но получают тип `log`, поэтому фронтенд может отображать их отдельно от ответов модели.
|
|
@@ -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
1
|
from typing import List, Optional, Any
|
|
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,23 @@ 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, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
217
254
|
"""
|
|
218
255
|
Factory function for creating a single file input type.
|
|
219
|
-
|
|
256
|
+
|
|
220
257
|
Args:
|
|
221
258
|
title: Title for the file input
|
|
222
259
|
file_extensions: Comma-separated list of allowed file extensions (e.g., ".pdf,.txt")
|
|
223
260
|
group: Group name for organizing inputs in the UI
|
|
224
261
|
hidden: Whether the input should be hidden in the UI
|
|
225
262
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
226
|
-
|
|
263
|
+
visibility: Visibility state of the field (default: "always")
|
|
264
|
+
|
|
227
265
|
Returns:
|
|
228
266
|
Type annotation for file input field
|
|
229
267
|
"""
|
|
@@ -234,14 +272,15 @@ def FileInput(title: str | None = None, file_extensions: str | None = None, grou
|
|
|
234
272
|
"group": group,
|
|
235
273
|
"hidden": hidden,
|
|
236
274
|
"depends": depends,
|
|
275
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
237
276
|
})
|
|
238
277
|
|
|
239
278
|
|
|
240
279
|
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) -> type:
|
|
280
|
+
hidden: bool | None = False, depends: str | None = None, limit: int | None = 10, visibility: str | Visibility = Visibility.ALWAYS) -> type:
|
|
242
281
|
"""
|
|
243
282
|
Factory function for creating a multiple files input type.
|
|
244
|
-
|
|
283
|
+
|
|
245
284
|
Args:
|
|
246
285
|
title: Title for the files input
|
|
247
286
|
file_extensions: Comma-separated list of allowed file extensions (e.g., ".pdf,.txt")
|
|
@@ -249,6 +288,7 @@ def FilesInput(title: str | None = None, file_extensions: str | None = None, gro
|
|
|
249
288
|
hidden: Whether the input should be hidden in the UI
|
|
250
289
|
depends: Specifies the parameter that this value depends on or is derived from.
|
|
251
290
|
limit: Limit count files.
|
|
291
|
+
visibility: Visibility state of the field (default: "always")
|
|
252
292
|
|
|
253
293
|
Returns:
|
|
254
294
|
Type annotation for files input field
|
|
@@ -261,4 +301,5 @@ def FilesInput(title: str | None = None, file_extensions: str | None = None, gro
|
|
|
261
301
|
"hidden": hidden,
|
|
262
302
|
"depends": depends,
|
|
263
303
|
"limit": limit,
|
|
304
|
+
"visibility": visibility.value if isinstance(visibility, Visibility) else visibility,
|
|
264
305
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-lab-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.45
|
|
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
|
# Массив строк
|
|
@@ -327,18 +328,18 @@ class AgentState(BaseModel):
|
|
|
327
328
|
|
|
328
329
|
#### Доступные фабричные функции
|
|
329
330
|
|
|
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` |
|
|
331
|
+
| Тип | Описание | Основные параметры |
|
|
332
|
+
|--------------------------|-----------------------------------|-----------------------------------------------------------------------------------|
|
|
333
|
+
| `MainInput` | Основное поле ввода | `placeholder`, `visibility` |
|
|
334
|
+
| `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
335
|
+
| `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
336
|
+
| `StringArrayInputInline` | Массив строк в одной строке ввода | `placeholder`, `title`, `description`, `group`, `hidden`, `depends`, `visibility` |
|
|
337
|
+
| `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden`, `depends`, `visibility` |
|
|
338
|
+
| `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden`, `depends`, `visibility` |
|
|
339
|
+
| `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
340
|
+
| `SwitchInput` | Switch | `title`, `group`, `description`, `default`, `hidden`, `depends`, `visibility` |
|
|
341
|
+
| `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden`, `depends`, `visibility` |
|
|
342
|
+
| `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden`, `depends`, `limit`, `visibility` |
|
|
342
343
|
|
|
343
344
|
#### Группировка полей
|
|
344
345
|
|
|
@@ -371,6 +372,54 @@ class TaskConfig(BaseModel):
|
|
|
371
372
|
)]
|
|
372
373
|
```
|
|
373
374
|
|
|
375
|
+
#### Управление видимостью полей
|
|
376
|
+
|
|
377
|
+
Параметр `visibility` контролирует, когда поле отображается в интерфейсе. Доступные значения:
|
|
378
|
+
|
|
379
|
+
```python
|
|
380
|
+
from agent_lab_sdk.schema import Visibility
|
|
381
|
+
|
|
382
|
+
# Enum с тремя значениями:
|
|
383
|
+
Visibility.ALWAYS # "always" - поле всегда доступно для ввода (по умолчанию)
|
|
384
|
+
Visibility.START # "start" - поле доступно для ввода только при старте
|
|
385
|
+
Visibility.AFTER_START # "after_start" - поле доступно для ввода после старта
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
**Пример использования:**
|
|
389
|
+
|
|
390
|
+
```python
|
|
391
|
+
class AgentConfig(BaseModel):
|
|
392
|
+
# Всегда доступно для ввода поле
|
|
393
|
+
query: Annotated[str, MainInput(
|
|
394
|
+
placeholder="Введите запрос",
|
|
395
|
+
visibility=Visibility.ALWAYS
|
|
396
|
+
)]
|
|
397
|
+
|
|
398
|
+
# Поле доступно для ввода только при первом запуске
|
|
399
|
+
api_key: Annotated[str, StringInput(
|
|
400
|
+
title="API ключ",
|
|
401
|
+
description="Ключ для доступа к внешнему API",
|
|
402
|
+
visibility=Visibility.START
|
|
403
|
+
)]
|
|
404
|
+
|
|
405
|
+
# Поле появляется после первого сообщения
|
|
406
|
+
session_id: Annotated[str, StringInput(
|
|
407
|
+
title="ID сессии",
|
|
408
|
+
description="Идентификатор текущей сессии",
|
|
409
|
+
visibility=Visibility.AFTER_START,
|
|
410
|
+
hidden=True
|
|
411
|
+
)]
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
Можно также передавать строковые значения напрямую:
|
|
415
|
+
|
|
416
|
+
```python
|
|
417
|
+
title: Annotated[str, StringInput(
|
|
418
|
+
title="Заголовок",
|
|
419
|
+
visibility="always" # эквивалентно Visibility.ALWAYS
|
|
420
|
+
)]
|
|
421
|
+
```
|
|
422
|
+
|
|
374
423
|
### 5.2. LogMessage
|
|
375
424
|
|
|
376
425
|
`LogMessage` — вспомогательное сообщение для потоковой передачи логов из узлов LangGraph / LangChain. Экземпляры создаются как обычные сообщения чата, но получают тип `log`, поэтому фронтенд может отображать их отдельно от ответов модели.
|
|
File without changes
|
|
File without changes
|
{agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/langgraph/checkpoint/__init__.py
RENAMED
|
File without changes
|
{agent_lab_sdk-0.1.44 → agent_lab_sdk-0.1.45}/agent_lab_sdk/langgraph/checkpoint/agw_saver.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|