agent-lab-sdk 0.1.15__tar.gz → 0.1.16__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.

Files changed (26) hide show
  1. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/PKG-INFO +121 -11
  2. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/README.md +120 -10
  3. agent_lab_sdk-0.1.16/agent_lab_sdk/schema/__init__.py +25 -0
  4. agent_lab_sdk-0.1.16/agent_lab_sdk/schema/input_types.py +193 -0
  5. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk.egg-info/PKG-INFO +121 -11
  6. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk.egg-info/SOURCES.txt +1 -0
  7. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/pyproject.toml +1 -1
  8. agent_lab_sdk-0.1.15/agent_lab_sdk/schema/__init__.py +0 -2
  9. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/LICENSE +0 -0
  10. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/__init__.py +0 -0
  11. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/langgraph/checkpoint/__init__.py +0 -0
  12. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/langgraph/checkpoint/agw_saver.py +0 -0
  13. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/llm/__init__.py +0 -0
  14. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/llm/agw_token_manager.py +0 -0
  15. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/llm/gigachat_token_manager.py +0 -0
  16. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/llm/llm.py +0 -0
  17. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/llm/throttled.py +0 -0
  18. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/metrics/__init__.py +0 -0
  19. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/metrics/metrics.py +0 -0
  20. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/schema/log_message.py +0 -0
  21. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/storage/__init__.py +0 -0
  22. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk/storage/storage.py +0 -0
  23. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk.egg-info/dependency_links.txt +0 -0
  24. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk.egg-info/requires.txt +0 -0
  25. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/agent_lab_sdk.egg-info/top_level.txt +0 -0
  26. {agent_lab_sdk-0.1.15 → agent_lab_sdk-0.1.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-lab-sdk
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Summary: SDK для работы с Agent Lab
5
5
  Author-email: Andrew Ohurtsov <andermirik@yandex.com>
6
6
  License: Proprietary and Confidential — All Rights Reserved
@@ -68,8 +68,6 @@ model = get_model(
68
68
 
69
69
  > если не передавать access_token, токен будет выбран через GigaChatTokenManager
70
70
 
71
- > планы на ближайшее будущее: get_model оборачивает внутри себя throttled классы.
72
-
73
71
  ### 1.2. Менеджеры токенов
74
72
 
75
73
  | Класс | Описание | Пример использования |
@@ -95,8 +93,6 @@ model = get_model(
95
93
 
96
94
  ---
97
95
 
98
- <a name="throttled"></a>
99
-
100
96
  ## 2. Модуль `agent_lab_sdk.llm.throttled`
101
97
 
102
98
  Позволяет ограничивать число одновременных вызовов к GigaChat и сервису эмбеддингов, автоматически собирая соответствующие метрики.
@@ -139,8 +135,6 @@ vectors = emb.embed_documents(["Text1", "Text2"])
139
135
 
140
136
  ---
141
137
 
142
- <a name="metrics"></a>
143
-
144
138
  ## 3. Модуль `agent_lab_sdk.metrics`
145
139
 
146
140
  Предоставляет удобный интерфейс для создания и управления метриками через Prometheus-клиент.
@@ -211,6 +205,126 @@ AGW поддерживает langgraph checkpoint API и в SDK представ
211
205
 
212
206
  ## 5. Схема
213
207
 
208
+ ### 5.1. Типы входных данных
209
+
210
+ Модуль `agent_lab_sdk.schema.input_types` предоставляет фабричные функции для создания аннотированных типов полей, которые могут использоваться в Pydantic моделях для описания интерфейса агентов.
211
+
212
+ #### Основные типы полей
213
+
214
+ ```python
215
+ from typing import List, Annotated
216
+ from pydantic import BaseModel, Field
217
+ from agent_lab_sdk.schema import (
218
+ MainInput, StringInput, StringArrayInput, NumberInput,
219
+ SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption
220
+ )
221
+
222
+ class AgentState(BaseModel):
223
+ # Основное поле ввода
224
+ query: Annotated[str, MainInput(placeholder="Введите ваш запрос")]
225
+
226
+ # Строковое поле
227
+ title: Annotated[str, StringInput(
228
+ default="Без названия",
229
+ title="Заголовок",
230
+ description="Название для вашего запроса"
231
+ )]
232
+
233
+ # Массив строк
234
+ keywords: Annotated[List[str], StringArrayInput(
235
+ placeholder="Добавьте ключевые слова...",
236
+ title="Ключевые слова",
237
+ description="Список ключевых слов для поиска",
238
+ group="Параметры"
239
+ )]
240
+
241
+ # Числовое поле
242
+ temperature: Annotated[float, NumberInput(
243
+ default=0.7,
244
+ title="Температура",
245
+ description="Параметр креативности модели (0.0 - 1.0)",
246
+ hidden=True
247
+ )]
248
+
249
+ # Выпадающий список
250
+ mode: Annotated[str, SelectInput(
251
+ title="Режим работы",
252
+ items=[
253
+ SelectOption(label="Быстрый", value="fast").model_dump(),
254
+ SelectOption(label="Точный", value="precise").model_dump()
255
+ ],
256
+ default="fast",
257
+ group="Настройки"
258
+ )]
259
+
260
+ # Чекбокс
261
+ save_history: Annotated[bool, CheckboxInput(
262
+ title="Сохранять историю",
263
+ description="Сохранять диалог для последующего анализа",
264
+ default=True,
265
+ group="Опции"
266
+ )]
267
+
268
+ # Загрузка одного файла
269
+ document: Annotated[str, FileInput(
270
+ title="Документ",
271
+ file_extensions=".pdf,.docx,.txt"
272
+ )]
273
+
274
+ # Загрузка нескольких файлов
275
+ attachments: Annotated[List[str], FilesInput(
276
+ title="Прикрепленные файлы",
277
+ file_extensions=".pdf,.csv,.xlsx",
278
+ group="Файлы"
279
+ )]
280
+ ```
281
+
282
+ #### Доступные фабричные функции
283
+
284
+ | Тип | Описание | Основные параметры |
285
+ |--------------------| ------------------------------------- | ----------------------------------------------------- |
286
+ | `MainInput` | Основное поле ввода | `placeholder` |
287
+ | `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden` |
288
+ | `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden` |
289
+ | `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden` |
290
+ | `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden` |
291
+ | `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden` |
292
+ | `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden` |
293
+ | `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden` |
294
+
295
+ #### Группировка полей
296
+
297
+ Используйте параметр `group` для логической группировки полей в интерфейсе:
298
+
299
+ ```python
300
+ class TaskConfig(BaseModel):
301
+ # Группа "Основные параметры"
302
+ task_type: Annotated[str, SelectInput(
303
+ title="Тип задачи",
304
+ items=[...],
305
+ group="Основные параметры"
306
+ )]
307
+
308
+ priority: Annotated[str, SelectInput(
309
+ title="Приоритет",
310
+ items=[...],
311
+ group="Основные параметры"
312
+ )]
313
+
314
+ # Группа "Дополнительно"
315
+ notifications: Annotated[bool, CheckboxInput(
316
+ title="Уведомления",
317
+ group="Дополнительно"
318
+ )]
319
+
320
+ tags: Annotated[List[str], StringArrayInput(
321
+ placeholder="Теги...",
322
+ group="Дополнительно"
323
+ )]
324
+ ```
325
+
326
+ ### 5.2. LogMessage
327
+
214
328
  TODO: описание LogMessage
215
329
 
216
330
  ## 6. Сборка и публикация
@@ -236,7 +350,3 @@ python -m build && python -m twine upload dist/*
236
350
  ```bash
237
351
  pip install -e .
238
352
  ```
239
-
240
- # Примеры использования
241
-
242
- TBD
@@ -39,8 +39,6 @@ model = get_model(
39
39
 
40
40
  > если не передавать access_token, токен будет выбран через GigaChatTokenManager
41
41
 
42
- > планы на ближайшее будущее: get_model оборачивает внутри себя throttled классы.
43
-
44
42
  ### 1.2. Менеджеры токенов
45
43
 
46
44
  | Класс | Описание | Пример использования |
@@ -66,8 +64,6 @@ model = get_model(
66
64
 
67
65
  ---
68
66
 
69
- <a name="throttled"></a>
70
-
71
67
  ## 2. Модуль `agent_lab_sdk.llm.throttled`
72
68
 
73
69
  Позволяет ограничивать число одновременных вызовов к GigaChat и сервису эмбеддингов, автоматически собирая соответствующие метрики.
@@ -110,8 +106,6 @@ vectors = emb.embed_documents(["Text1", "Text2"])
110
106
 
111
107
  ---
112
108
 
113
- <a name="metrics"></a>
114
-
115
109
  ## 3. Модуль `agent_lab_sdk.metrics`
116
110
 
117
111
  Предоставляет удобный интерфейс для создания и управления метриками через Prometheus-клиент.
@@ -182,6 +176,126 @@ AGW поддерживает langgraph checkpoint API и в SDK представ
182
176
 
183
177
  ## 5. Схема
184
178
 
179
+ ### 5.1. Типы входных данных
180
+
181
+ Модуль `agent_lab_sdk.schema.input_types` предоставляет фабричные функции для создания аннотированных типов полей, которые могут использоваться в Pydantic моделях для описания интерфейса агентов.
182
+
183
+ #### Основные типы полей
184
+
185
+ ```python
186
+ from typing import List, Annotated
187
+ from pydantic import BaseModel, Field
188
+ from agent_lab_sdk.schema import (
189
+ MainInput, StringInput, StringArrayInput, NumberInput,
190
+ SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption
191
+ )
192
+
193
+ class AgentState(BaseModel):
194
+ # Основное поле ввода
195
+ query: Annotated[str, MainInput(placeholder="Введите ваш запрос")]
196
+
197
+ # Строковое поле
198
+ title: Annotated[str, StringInput(
199
+ default="Без названия",
200
+ title="Заголовок",
201
+ description="Название для вашего запроса"
202
+ )]
203
+
204
+ # Массив строк
205
+ keywords: Annotated[List[str], StringArrayInput(
206
+ placeholder="Добавьте ключевые слова...",
207
+ title="Ключевые слова",
208
+ description="Список ключевых слов для поиска",
209
+ group="Параметры"
210
+ )]
211
+
212
+ # Числовое поле
213
+ temperature: Annotated[float, NumberInput(
214
+ default=0.7,
215
+ title="Температура",
216
+ description="Параметр креативности модели (0.0 - 1.0)",
217
+ hidden=True
218
+ )]
219
+
220
+ # Выпадающий список
221
+ mode: Annotated[str, SelectInput(
222
+ title="Режим работы",
223
+ items=[
224
+ SelectOption(label="Быстрый", value="fast").model_dump(),
225
+ SelectOption(label="Точный", value="precise").model_dump()
226
+ ],
227
+ default="fast",
228
+ group="Настройки"
229
+ )]
230
+
231
+ # Чекбокс
232
+ save_history: Annotated[bool, CheckboxInput(
233
+ title="Сохранять историю",
234
+ description="Сохранять диалог для последующего анализа",
235
+ default=True,
236
+ group="Опции"
237
+ )]
238
+
239
+ # Загрузка одного файла
240
+ document: Annotated[str, FileInput(
241
+ title="Документ",
242
+ file_extensions=".pdf,.docx,.txt"
243
+ )]
244
+
245
+ # Загрузка нескольких файлов
246
+ attachments: Annotated[List[str], FilesInput(
247
+ title="Прикрепленные файлы",
248
+ file_extensions=".pdf,.csv,.xlsx",
249
+ group="Файлы"
250
+ )]
251
+ ```
252
+
253
+ #### Доступные фабричные функции
254
+
255
+ | Тип | Описание | Основные параметры |
256
+ |--------------------| ------------------------------------- | ----------------------------------------------------- |
257
+ | `MainInput` | Основное поле ввода | `placeholder` |
258
+ | `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden` |
259
+ | `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden` |
260
+ | `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden` |
261
+ | `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden` |
262
+ | `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden` |
263
+ | `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden` |
264
+ | `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden` |
265
+
266
+ #### Группировка полей
267
+
268
+ Используйте параметр `group` для логической группировки полей в интерфейсе:
269
+
270
+ ```python
271
+ class TaskConfig(BaseModel):
272
+ # Группа "Основные параметры"
273
+ task_type: Annotated[str, SelectInput(
274
+ title="Тип задачи",
275
+ items=[...],
276
+ group="Основные параметры"
277
+ )]
278
+
279
+ priority: Annotated[str, SelectInput(
280
+ title="Приоритет",
281
+ items=[...],
282
+ group="Основные параметры"
283
+ )]
284
+
285
+ # Группа "Дополнительно"
286
+ notifications: Annotated[bool, CheckboxInput(
287
+ title="Уведомления",
288
+ group="Дополнительно"
289
+ )]
290
+
291
+ tags: Annotated[List[str], StringArrayInput(
292
+ placeholder="Теги...",
293
+ group="Дополнительно"
294
+ )]
295
+ ```
296
+
297
+ ### 5.2. LogMessage
298
+
185
299
  TODO: описание LogMessage
186
300
 
187
301
  ## 6. Сборка и публикация
@@ -207,7 +321,3 @@ python -m build && python -m twine upload dist/*
207
321
  ```bash
208
322
  pip install -e .
209
323
  ```
210
-
211
- # Примеры использования
212
-
213
- TBD
@@ -0,0 +1,25 @@
1
+ from .log_message import LogMessage
2
+ from .input_types import (
3
+ MainInput,
4
+ StringInput,
5
+ StringArrayInput,
6
+ NumberInput,
7
+ SelectInput,
8
+ CheckboxInput,
9
+ FileInput,
10
+ FilesInput,
11
+ SelectOption
12
+ )
13
+
14
+ __all__ = [
15
+ "LogMessage",
16
+ "MainInput",
17
+ "StringInput",
18
+ "StringArrayInput",
19
+ "NumberInput",
20
+ "SelectInput",
21
+ "CheckboxInput",
22
+ "FileInput",
23
+ "FilesInput",
24
+ "SelectOption"
25
+ ]
@@ -0,0 +1,193 @@
1
+ from typing import List, Optional, Any
2
+ from pydantic import BaseModel
3
+ from pydantic.json_schema import WithJsonSchema
4
+
5
+
6
+ def MainInput(placeholder: str | None = None) -> type:
7
+ """
8
+ Factory function for creating a main input type with optional placeholder.
9
+
10
+ Args:
11
+ placeholder: Optional placeholder text for the input field
12
+
13
+ Returns:
14
+ Type annotation for main input field
15
+ """
16
+ return WithJsonSchema({
17
+ "type": "main-input",
18
+ "placeholder": placeholder,
19
+ })
20
+
21
+
22
+ def StringInput(default: str | None = None, title: str | None = None, description: str | None = None, hidden: bool | None = False) -> type:
23
+ """
24
+ Factory function for creating a string input type.
25
+
26
+ Args:
27
+ default: Default value for the string input
28
+ title: Title for the string input
29
+ description: Description text for the string input
30
+ hidden: Whether the input should be hidden in the UI
31
+
32
+ Returns:
33
+ Type annotation for string input field
34
+ """
35
+ return WithJsonSchema({
36
+ "type": "input-string",
37
+ "default": default,
38
+ "title": title,
39
+ "description": description,
40
+ "hidden": hidden,
41
+ })
42
+
43
+
44
+ def StringArrayInput(placeholder: str | None = None, title: str | None = None, description: str | None = None, group: str | None = None, hidden: bool | None = False) -> type:
45
+ """
46
+ Factory function for creating a string array input type.
47
+
48
+ Args:
49
+ placeholder: Placeholder text for the input field
50
+ title: Title for the string array input
51
+ description: Description text for the string array input
52
+ group: Group name for organizing inputs in the UI
53
+ hidden: Whether the input should be hidden in the UI
54
+
55
+ Returns:
56
+ Type annotation for string array input field
57
+ """
58
+ return WithJsonSchema({
59
+ "type": "string[]-inline",
60
+ "placeholder": placeholder,
61
+ "title": title,
62
+ "description": description,
63
+ "group": group,
64
+ "hidden": hidden,
65
+ })
66
+
67
+
68
+ def NumberInput(default: float | None = None, title: str | None = None, description: str | None = None, hidden: bool | None = False) -> type:
69
+ """
70
+ Factory function for creating a number input type.
71
+
72
+ Args:
73
+ default: Default value for the number input
74
+ title: Title for the number input
75
+ description: Description text for the number input
76
+ hidden: Whether the input should be hidden in the UI
77
+
78
+ Returns:
79
+ Type annotation for number input field
80
+ """
81
+ return WithJsonSchema({
82
+ "type": "input-number",
83
+ "default": default,
84
+ "title": title,
85
+ "description": description,
86
+ "hidden": hidden,
87
+ })
88
+
89
+
90
+ class SelectOption(BaseModel):
91
+ """
92
+ Model representing an option in a select input.
93
+
94
+ Attributes:
95
+ label: Display label for the option
96
+ value: Actual value of the option
97
+ description: Optional description for the option
98
+ """
99
+ label: str
100
+ value: str
101
+ description: Optional[str] = None
102
+
103
+
104
+ def SelectInput(items: List[Any] = [], title: str | None = None, group: str | None = None, default: str | None = None, hidden: bool | None = False) -> type:
105
+ """
106
+ Factory function for creating a select input type.
107
+
108
+ Args:
109
+ items: List of SelectOption objects or dictionaries
110
+ title: Title for the select input
111
+ group: Group name for organizing inputs in the UI
112
+ default: Default selected value
113
+ hidden: Whether the input should be hidden in the UI
114
+
115
+ Returns:
116
+ Type annotation for select input field
117
+ """
118
+ return WithJsonSchema({
119
+ "type": "select",
120
+ "title": title,
121
+ "items": items,
122
+ "group": group,
123
+ "default": default,
124
+ "hidden": hidden,
125
+ })
126
+
127
+
128
+ def CheckboxInput(title: str | None = None, group: str | None = None, description: str | None = None, default: bool | None = False, hidden: bool | None = False) -> type:
129
+ """
130
+ Factory function for creating a checkbox input type.
131
+
132
+ Args:
133
+ title: Title for the checkbox
134
+ group: Group name for organizing inputs in the UI
135
+ description: Description text for the checkbox
136
+ default: Default checked state
137
+ hidden: Whether the input should be hidden in the UI
138
+
139
+ Returns:
140
+ Type annotation for checkbox input field
141
+ """
142
+ return WithJsonSchema({
143
+ "type": "checkbox",
144
+ "title": title,
145
+ "group": group,
146
+ "description": description,
147
+ "default": default,
148
+ "hidden": hidden,
149
+ })
150
+
151
+
152
+ def FileInput(title: str | None = None, file_extensions: str | None = None, group: str | None = None, hidden: bool | None = False) -> type:
153
+ """
154
+ Factory function for creating a single file input type.
155
+
156
+ Args:
157
+ title: Title for the file input
158
+ file_extensions: Comma-separated list of allowed file extensions (e.g., ".pdf,.txt")
159
+ group: Group name for organizing inputs in the UI
160
+ hidden: Whether the input should be hidden in the UI
161
+
162
+ Returns:
163
+ Type annotation for file input field
164
+ """
165
+ return WithJsonSchema({
166
+ "type": "files",
167
+ "title": title,
168
+ "fileExtensions": file_extensions,
169
+ "group": group,
170
+ "hidden": hidden,
171
+ })
172
+
173
+
174
+ def FilesInput(title: str | None = None, file_extensions: str | None = None, group: str | None = None, hidden: bool | None = False) -> type:
175
+ """
176
+ Factory function for creating a multiple files input type.
177
+
178
+ Args:
179
+ title: Title for the files input
180
+ file_extensions: Comma-separated list of allowed file extensions (e.g., ".pdf,.txt")
181
+ group: Group name for organizing inputs in the UI
182
+ hidden: Whether the input should be hidden in the UI
183
+
184
+ Returns:
185
+ Type annotation for files input field
186
+ """
187
+ return WithJsonSchema({
188
+ "type": "files",
189
+ "title": title,
190
+ "fileExtensions": file_extensions,
191
+ "group": group,
192
+ "hidden": hidden,
193
+ })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-lab-sdk
3
- Version: 0.1.15
3
+ Version: 0.1.16
4
4
  Summary: SDK для работы с Agent Lab
5
5
  Author-email: Andrew Ohurtsov <andermirik@yandex.com>
6
6
  License: Proprietary and Confidential — All Rights Reserved
@@ -68,8 +68,6 @@ model = get_model(
68
68
 
69
69
  > если не передавать access_token, токен будет выбран через GigaChatTokenManager
70
70
 
71
- > планы на ближайшее будущее: get_model оборачивает внутри себя throttled классы.
72
-
73
71
  ### 1.2. Менеджеры токенов
74
72
 
75
73
  | Класс | Описание | Пример использования |
@@ -95,8 +93,6 @@ model = get_model(
95
93
 
96
94
  ---
97
95
 
98
- <a name="throttled"></a>
99
-
100
96
  ## 2. Модуль `agent_lab_sdk.llm.throttled`
101
97
 
102
98
  Позволяет ограничивать число одновременных вызовов к GigaChat и сервису эмбеддингов, автоматически собирая соответствующие метрики.
@@ -139,8 +135,6 @@ vectors = emb.embed_documents(["Text1", "Text2"])
139
135
 
140
136
  ---
141
137
 
142
- <a name="metrics"></a>
143
-
144
138
  ## 3. Модуль `agent_lab_sdk.metrics`
145
139
 
146
140
  Предоставляет удобный интерфейс для создания и управления метриками через Prometheus-клиент.
@@ -211,6 +205,126 @@ AGW поддерживает langgraph checkpoint API и в SDK представ
211
205
 
212
206
  ## 5. Схема
213
207
 
208
+ ### 5.1. Типы входных данных
209
+
210
+ Модуль `agent_lab_sdk.schema.input_types` предоставляет фабричные функции для создания аннотированных типов полей, которые могут использоваться в Pydantic моделях для описания интерфейса агентов.
211
+
212
+ #### Основные типы полей
213
+
214
+ ```python
215
+ from typing import List, Annotated
216
+ from pydantic import BaseModel, Field
217
+ from agent_lab_sdk.schema import (
218
+ MainInput, StringInput, StringArrayInput, NumberInput,
219
+ SelectInput, CheckboxInput, FileInput, FilesInput, SelectOption
220
+ )
221
+
222
+ class AgentState(BaseModel):
223
+ # Основное поле ввода
224
+ query: Annotated[str, MainInput(placeholder="Введите ваш запрос")]
225
+
226
+ # Строковое поле
227
+ title: Annotated[str, StringInput(
228
+ default="Без названия",
229
+ title="Заголовок",
230
+ description="Название для вашего запроса"
231
+ )]
232
+
233
+ # Массив строк
234
+ keywords: Annotated[List[str], StringArrayInput(
235
+ placeholder="Добавьте ключевые слова...",
236
+ title="Ключевые слова",
237
+ description="Список ключевых слов для поиска",
238
+ group="Параметры"
239
+ )]
240
+
241
+ # Числовое поле
242
+ temperature: Annotated[float, NumberInput(
243
+ default=0.7,
244
+ title="Температура",
245
+ description="Параметр креативности модели (0.0 - 1.0)",
246
+ hidden=True
247
+ )]
248
+
249
+ # Выпадающий список
250
+ mode: Annotated[str, SelectInput(
251
+ title="Режим работы",
252
+ items=[
253
+ SelectOption(label="Быстрый", value="fast").model_dump(),
254
+ SelectOption(label="Точный", value="precise").model_dump()
255
+ ],
256
+ default="fast",
257
+ group="Настройки"
258
+ )]
259
+
260
+ # Чекбокс
261
+ save_history: Annotated[bool, CheckboxInput(
262
+ title="Сохранять историю",
263
+ description="Сохранять диалог для последующего анализа",
264
+ default=True,
265
+ group="Опции"
266
+ )]
267
+
268
+ # Загрузка одного файла
269
+ document: Annotated[str, FileInput(
270
+ title="Документ",
271
+ file_extensions=".pdf,.docx,.txt"
272
+ )]
273
+
274
+ # Загрузка нескольких файлов
275
+ attachments: Annotated[List[str], FilesInput(
276
+ title="Прикрепленные файлы",
277
+ file_extensions=".pdf,.csv,.xlsx",
278
+ group="Файлы"
279
+ )]
280
+ ```
281
+
282
+ #### Доступные фабричные функции
283
+
284
+ | Тип | Описание | Основные параметры |
285
+ |--------------------| ------------------------------------- | ----------------------------------------------------- |
286
+ | `MainInput` | Основное поле ввода | `placeholder` |
287
+ | `StringInput` | Текстовое поле | `default`, `title`, `description`, `hidden` |
288
+ | `StringArrayInput` | Массив строк | `placeholder`, `title`, `description`, `group`, `hidden` |
289
+ | `NumberInput` | Числовое поле | `default`, `title`, `description`, `hidden` |
290
+ | `SelectInput` | Выпадающий список | `items`, `title`, `group`, `default`, `hidden` |
291
+ | `CheckboxInput` | Чекбокс | `title`, `group`, `description`, `default`, `hidden` |
292
+ | `FileInput` | Загрузка одного файла | `title`, `file_extensions`, `group`, `hidden` |
293
+ | `FilesInput` | Загрузка нескольких файлов | `title`, `file_extensions`, `group`, `hidden` |
294
+
295
+ #### Группировка полей
296
+
297
+ Используйте параметр `group` для логической группировки полей в интерфейсе:
298
+
299
+ ```python
300
+ class TaskConfig(BaseModel):
301
+ # Группа "Основные параметры"
302
+ task_type: Annotated[str, SelectInput(
303
+ title="Тип задачи",
304
+ items=[...],
305
+ group="Основные параметры"
306
+ )]
307
+
308
+ priority: Annotated[str, SelectInput(
309
+ title="Приоритет",
310
+ items=[...],
311
+ group="Основные параметры"
312
+ )]
313
+
314
+ # Группа "Дополнительно"
315
+ notifications: Annotated[bool, CheckboxInput(
316
+ title="Уведомления",
317
+ group="Дополнительно"
318
+ )]
319
+
320
+ tags: Annotated[List[str], StringArrayInput(
321
+ placeholder="Теги...",
322
+ group="Дополнительно"
323
+ )]
324
+ ```
325
+
326
+ ### 5.2. LogMessage
327
+
214
328
  TODO: описание LogMessage
215
329
 
216
330
  ## 6. Сборка и публикация
@@ -236,7 +350,3 @@ python -m build && python -m twine upload dist/*
236
350
  ```bash
237
351
  pip install -e .
238
352
  ```
239
-
240
- # Примеры использования
241
-
242
- TBD
@@ -17,6 +17,7 @@ agent_lab_sdk/llm/throttled.py
17
17
  agent_lab_sdk/metrics/__init__.py
18
18
  agent_lab_sdk/metrics/metrics.py
19
19
  agent_lab_sdk/schema/__init__.py
20
+ agent_lab_sdk/schema/input_types.py
20
21
  agent_lab_sdk/schema/log_message.py
21
22
  agent_lab_sdk/storage/__init__.py
22
23
  agent_lab_sdk/storage/storage.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "agent-lab-sdk"
7
- version = "0.1.15"
7
+ version = "0.1.16"
8
8
  description = "SDK для работы с Agent Lab"
9
9
  readme = "README.md"
10
10
  license = { text = "Proprietary and Confidential — All Rights Reserved" }
@@ -1,2 +0,0 @@
1
- from .log_message import LogMessage
2
- __all__ = ["LogMessage"]
File without changes
File without changes