alita-sdk 0.3.285__py3-none-any.whl → 0.3.287__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.
- alita_sdk/runtime/langchain/document_loaders/constants.py +46 -23
- alita_sdk/tools/testrail/api_wrapper.py +9 -4
- alita_sdk/tools/utils/content_parser.py +11 -1
- alita_sdk/tools/zephyr_enterprise/api_wrapper.py +9 -5
- {alita_sdk-0.3.285.dist-info → alita_sdk-0.3.287.dist-info}/METADATA +1 -1
- {alita_sdk-0.3.285.dist-info → alita_sdk-0.3.287.dist-info}/RECORD +9 -9
- {alita_sdk-0.3.285.dist-info → alita_sdk-0.3.287.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.285.dist-info → alita_sdk-0.3.287.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.285.dist-info → alita_sdk-0.3.287.dist-info}/top_level.txt +0 -0
@@ -30,65 +30,76 @@ loaders_map = {
|
|
30
30
|
'.png': {
|
31
31
|
'class': AlitaImageLoader,
|
32
32
|
'is_multimodal_processing': True,
|
33
|
-
'kwargs': {}
|
33
|
+
'kwargs': {},
|
34
|
+
'allowed_to_override': ['max_tokens']
|
34
35
|
},
|
35
36
|
'.jpg': {
|
36
37
|
'class': AlitaImageLoader,
|
37
38
|
'is_multimodal_processing': True,
|
38
|
-
'kwargs': {}
|
39
|
+
'kwargs': {},
|
40
|
+
'allowed_to_override': ['max_tokens']
|
39
41
|
},
|
40
42
|
'.jpeg': {
|
41
43
|
'class': AlitaImageLoader,
|
42
44
|
'is_multimodal_processing': True,
|
43
|
-
'kwargs': {}
|
45
|
+
'kwargs': {},
|
46
|
+
'allowed_to_override': ['max_tokens']
|
44
47
|
},
|
45
48
|
'.gif': {
|
46
49
|
'class': AlitaImageLoader,
|
47
50
|
'is_multimodal_processing': True,
|
48
|
-
'kwargs': {}
|
51
|
+
'kwargs': {},
|
52
|
+
'allowed_to_override': ['max_tokens']
|
49
53
|
},
|
50
54
|
'.bmp': {
|
51
55
|
'class': AlitaImageLoader,
|
52
56
|
'is_multimodal_processing': True,
|
53
|
-
'kwargs': {}
|
57
|
+
'kwargs': {},
|
58
|
+
'allowed_to_override': ['max_tokens']
|
54
59
|
},
|
55
60
|
'.svg': {
|
56
61
|
'class': AlitaImageLoader,
|
57
62
|
'is_multimodal_processing': True,
|
58
|
-
'kwargs': {}
|
63
|
+
'kwargs': {},
|
64
|
+
'allowed_to_override': ['max_tokens']
|
59
65
|
},
|
60
66
|
'.txt': {
|
61
67
|
'class': AlitaTextLoader,
|
62
68
|
'is_multimodal_processing': False,
|
63
69
|
'kwargs': {
|
64
70
|
'autodetect_encoding': True
|
65
|
-
}
|
71
|
+
},
|
72
|
+
'allowed_to_override': ['max_tokens']
|
66
73
|
},
|
67
74
|
'.yml': {
|
68
75
|
'class': AlitaTextLoader,
|
69
76
|
'is_multimodal_processing': False,
|
70
77
|
'kwargs': {
|
71
78
|
'autodetect_encoding': True
|
72
|
-
}
|
79
|
+
},
|
80
|
+
'allowed_to_override': ['max_tokens']
|
73
81
|
},
|
74
82
|
'.yaml': {
|
75
83
|
'class': AlitaTextLoader,
|
76
84
|
'is_multimodal_processing': False,
|
77
85
|
'kwargs': {
|
78
86
|
'autodetect_encoding': True
|
79
|
-
}
|
87
|
+
},
|
88
|
+
'allowed_to_override': ['max_tokens']
|
80
89
|
},
|
81
90
|
'.groovy': {
|
82
91
|
'class': AlitaTextLoader,
|
83
92
|
'is_multimodal_processing': False,
|
84
93
|
'kwargs': {
|
85
94
|
'autodetect_encoding': True
|
86
|
-
}
|
95
|
+
},
|
96
|
+
'allowed_to_override': ['max_tokens']
|
87
97
|
},
|
88
98
|
'.md': {
|
89
99
|
'class': UnstructuredMarkdownLoader,
|
90
100
|
'is_multimodal_processing': False,
|
91
|
-
'kwargs': {}
|
101
|
+
'kwargs': {},
|
102
|
+
'allowed_to_override': ['max_tokens']
|
92
103
|
},
|
93
104
|
'.csv': {
|
94
105
|
'class': AlitaCSVLoader,
|
@@ -97,7 +108,8 @@ loaders_map = {
|
|
97
108
|
'encoding': 'utf-8',
|
98
109
|
'raw_content': False,
|
99
110
|
'cleanse': False
|
100
|
-
}
|
111
|
+
},
|
112
|
+
'allowed_to_override': ['max_tokens']
|
101
113
|
},
|
102
114
|
'.xlsx': {
|
103
115
|
'class': AlitaExcelLoader,
|
@@ -105,7 +117,8 @@ loaders_map = {
|
|
105
117
|
'kwargs': {
|
106
118
|
'raw_content': False,
|
107
119
|
'cleanse': False
|
108
|
-
}
|
120
|
+
},
|
121
|
+
'allowed_to_override': ['max_tokens']
|
109
122
|
},
|
110
123
|
'.xls': {
|
111
124
|
'class': AlitaExcelLoader,
|
@@ -113,57 +126,67 @@ loaders_map = {
|
|
113
126
|
'kwargs': {
|
114
127
|
'raw_content': False,
|
115
128
|
'cleanse': False
|
116
|
-
}
|
129
|
+
},
|
130
|
+
'allowed_to_override': ['max_tokens']
|
117
131
|
},
|
118
132
|
'.pdf': {
|
119
133
|
'class': AlitaPDFLoader,
|
120
134
|
'is_multimodal_processing': False,
|
121
|
-
'kwargs': {}
|
135
|
+
'kwargs': {},
|
136
|
+
'allowed_to_override': ['max_tokens']
|
122
137
|
},
|
123
138
|
'.docx': {
|
124
139
|
'class': AlitaDocxMammothLoader,
|
125
140
|
'is_multimodal_processing': True,
|
126
141
|
'kwargs': {
|
127
142
|
'extract_images': True
|
128
|
-
}
|
143
|
+
},
|
144
|
+
'allowed_to_override': ['max_tokens', 'mode']
|
129
145
|
},
|
130
146
|
'.json': {
|
131
147
|
'class': AlitaJSONLoader,
|
132
148
|
'is_multimodal_processing': False,
|
133
|
-
'kwargs': {}
|
149
|
+
'kwargs': {},
|
150
|
+
'allowed_to_override': ['max_tokens']
|
134
151
|
},
|
135
152
|
'.jsonl': {
|
136
153
|
'class': AirbyteJSONLoader,
|
137
154
|
'is_multimodal_processing': False,
|
138
|
-
'kwargs': {}
|
155
|
+
'kwargs': {},
|
156
|
+
'allowed_to_override': ['max_tokens']
|
139
157
|
},
|
140
158
|
'.htm': {
|
141
159
|
'class': UnstructuredHTMLLoader,
|
142
160
|
'is_multimodal_processing': False,
|
143
|
-
'kwargs': {}
|
161
|
+
'kwargs': {},
|
162
|
+
'allowed_to_override': ['max_tokens']
|
144
163
|
},
|
145
164
|
'.html': {
|
146
165
|
'class': UnstructuredHTMLLoader,
|
147
166
|
'is_multimodal_processing': False,
|
148
|
-
'kwargs': {}
|
167
|
+
'kwargs': {},
|
168
|
+
'allowed_to_override': ['max_tokens']
|
149
169
|
},
|
150
170
|
'.ppt': {
|
151
171
|
'class': AlitaPowerPointLoader,
|
152
172
|
'is_multimodal_processing': False,
|
153
173
|
'kwargs': {
|
154
174
|
'mode': 'paged'
|
155
|
-
}
|
175
|
+
},
|
176
|
+
'allowed_to_override': ['max_tokens', 'mode']
|
156
177
|
},
|
157
178
|
'.pptx': {
|
158
179
|
'class': AlitaPowerPointLoader,
|
159
180
|
'is_multimodal_processing': False,
|
160
181
|
'kwargs': {
|
161
182
|
'mode': 'paged'
|
162
|
-
}
|
183
|
+
},
|
184
|
+
'allowed_to_override': ['max_tokens', 'mode']
|
163
185
|
},
|
164
186
|
'.py': {
|
165
187
|
'class': PythonLoader,
|
166
188
|
'is_multimodal_processing': False,
|
167
|
-
'kwargs': {}
|
189
|
+
'kwargs': {},
|
190
|
+
'allowed_to_override': ['max_tokens']
|
168
191
|
}
|
169
192
|
}
|
@@ -599,7 +599,7 @@ class TestrailAPIWrapper(NonCodeIndexerToolkit):
|
|
599
599
|
return
|
600
600
|
|
601
601
|
# get base data from the document required to extract attachments and other metadata
|
602
|
-
base_data =
|
602
|
+
base_data = document.metadata
|
603
603
|
case_id = base_data.get("id")
|
604
604
|
|
605
605
|
# get a list of attachments for the case
|
@@ -616,6 +616,7 @@ class TestrailAPIWrapper(NonCodeIndexerToolkit):
|
|
616
616
|
yield Document(page_content="",
|
617
617
|
metadata={
|
618
618
|
'project_id': base_data.get('project_id', ''),
|
619
|
+
'updated_on': base_data.get('updated_on', ''),
|
619
620
|
'id': str(attachment_id),
|
620
621
|
'filename': attachment['filename'],
|
621
622
|
'filetype': attachment['filetype'],
|
@@ -639,17 +640,21 @@ class TestrailAPIWrapper(NonCodeIndexerToolkit):
|
|
639
640
|
str: string description of the attachment.
|
640
641
|
"""
|
641
642
|
|
642
|
-
page_content = "This filetype is not supported."
|
643
643
|
if attachment['filetype'] == 'txt' :
|
644
|
-
|
644
|
+
response = self._client.get(endpoint=f"get_attachment/{attachment['id']}")
|
645
|
+
if hasattr(response, "content"):
|
646
|
+
return attachment['filename'], response.content
|
647
|
+
elif isinstance(response, str):
|
648
|
+
return attachment['filename'], response.encode("utf-8")
|
645
649
|
else:
|
646
650
|
try:
|
647
651
|
attachment_path = self._client.attachments.get_attachment(attachment_id=attachment['id'], path=f"./{attachment['filename']}")
|
652
|
+
return attachment['filename'], attachment_path.read_bytes()
|
648
653
|
except BadRequestError as ai_e:
|
649
654
|
logger.error(f"Unable to parse page's content with type: {attachment['filetype']} due to AI service issues: {ai_e}")
|
650
655
|
except Exception as e:
|
651
656
|
logger.error(f"Unable to parse page's content with type: {attachment['filetype']}: {e}")
|
652
|
-
return
|
657
|
+
return attachment['filename'], b"This filetype is not supported."
|
653
658
|
|
654
659
|
def _index_tool_params(self):
|
655
660
|
return {
|
@@ -203,7 +203,7 @@ def load_content_from_bytes(file_content: bytes, extension: str = None, loader_e
|
|
203
203
|
if temp_file_path and os.path.exists(temp_file_path):
|
204
204
|
os.remove(temp_file_path)
|
205
205
|
|
206
|
-
def process_content_by_type(document: Document, content, extension_source: str, llm = None, chunking_config=
|
206
|
+
def process_content_by_type(document: Document, content, extension_source: str, llm = None, chunking_config=None) -> Generator[Document, None, None]:
|
207
207
|
temp_file_path = None
|
208
208
|
try:
|
209
209
|
extension = "." + extension_source.split('.')[-1].lower()
|
@@ -224,6 +224,16 @@ def process_content_by_type(document: Document, content, extension_source: str,
|
|
224
224
|
|
225
225
|
loader_cls = loader_config['class']
|
226
226
|
loader_kwargs = loader_config['kwargs']
|
227
|
+
# Determine which loader configuration keys are allowed to be overridden by user input.
|
228
|
+
# If 'allowed_to_override' is specified in the loader configuration, use it; otherwise, allow all keys in loader_kwargs.
|
229
|
+
allowed_to_override = loader_config.get('allowed_to_override', list(loader_kwargs.keys()))
|
230
|
+
# If a chunking_config is provided and contains custom configuration for the current file extension,
|
231
|
+
# update loader_kwargs with user-supplied values, but only for keys explicitly permitted in allowed_to_override.
|
232
|
+
# This ensures that only safe and intended parameters can be customized, preventing accidental or unauthorized changes
|
233
|
+
# to critical loader settings.
|
234
|
+
if chunking_config and (users_config_for_extension := chunking_config.get(extension, {})):
|
235
|
+
for key in set(users_config_for_extension.keys()) & set(allowed_to_override):
|
236
|
+
loader_kwargs[key] = users_config_for_extension[key]
|
227
237
|
|
228
238
|
loader = loader_cls(file_path=temp_file_path, **loader_kwargs)
|
229
239
|
for chunk in loader.load():
|
@@ -157,12 +157,16 @@ class ZephyrApiWrapper(NonCodeIndexerToolkit):
|
|
157
157
|
}
|
158
158
|
|
159
159
|
def _base_loader(self, zql: str, **kwargs) -> Generator[Document, None, None]:
|
160
|
-
test_cases = self.get_testcases_by_zql(zql)
|
160
|
+
test_cases = self.get_testcases_by_zql(zql=zql, return_as_list=True)
|
161
161
|
for test_case in test_cases:
|
162
162
|
metadata = {
|
163
|
-
|
164
|
-
|
165
|
-
|
163
|
+
"updated_on": str(test_case.get("lastModifiedOn")),
|
164
|
+
"id": str(test_case.get("id")),
|
165
|
+
"name": test_case.get("name"),
|
166
|
+
"testcaseId": str(test_case.get("testcaseId")),
|
167
|
+
"projectId": test_case.get("projectId"),
|
168
|
+
"projectName": test_case.get("projectName"),
|
169
|
+
"testcaseType": test_case.get("testcaseType"),
|
166
170
|
}
|
167
171
|
yield Document(page_content='', metadata=metadata)
|
168
172
|
|
@@ -171,7 +175,7 @@ class ZephyrApiWrapper(NonCodeIndexerToolkit):
|
|
171
175
|
try:
|
172
176
|
id = document.metadata['id']
|
173
177
|
test_case_content = self.get_test_case_steps(id)
|
174
|
-
document.page_content = test_case_content
|
178
|
+
document.page_content = f"Test case: {document.metadata['name']}\nTest_case_content: {test_case_content}"
|
175
179
|
except Exception as e:
|
176
180
|
logging.error(f"Failed to process document: {e}")
|
177
181
|
yield document
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: alita_sdk
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.287
|
4
4
|
Summary: SDK for building langchain agents using resources from Alita
|
5
5
|
Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedjik@gmail.com>, Artem Dubrovskiy <ad13box@gmail.com>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -68,7 +68,7 @@ alita_sdk/runtime/langchain/document_loaders/AlitaTableLoader.py,sha256=o0SRFPZ-
|
|
68
68
|
alita_sdk/runtime/langchain/document_loaders/AlitaTextLoader.py,sha256=uNcV0En49_0u0RYB1sP1XfNspT2Xc5CacuJr9Jqv79Q,2972
|
69
69
|
alita_sdk/runtime/langchain/document_loaders/ImageParser.py,sha256=gao5yCCKdDai_Gx7YdEx5U6oMyJYzn69eYmEvWLh-fc,656
|
70
70
|
alita_sdk/runtime/langchain/document_loaders/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
71
|
-
alita_sdk/runtime/langchain/document_loaders/constants.py,sha256=
|
71
|
+
alita_sdk/runtime/langchain/document_loaders/constants.py,sha256=9v4ZRbFy9SqyF5uaQwIAJ3IgGanb8ISoZMKgEYEhOLU,5594
|
72
72
|
alita_sdk/runtime/langchain/document_loaders/utils.py,sha256=9xghESf3axBbwxATyVuS0Yu-TWe8zWZnXgCD1ZVyNW0,2414
|
73
73
|
alita_sdk/runtime/langchain/interfaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
74
74
|
alita_sdk/runtime/langchain/interfaces/kwextractor.py,sha256=kSJA9L8g8UArmHu7Bd9dIO0Rrq86JPUb8RYNlnN68FQ,3072
|
@@ -322,10 +322,10 @@ alita_sdk/tools/sql/models.py,sha256=AKJgSl_kEEz4fZfw3kbvdGHXaRZ-yiaqfJOB6YOj3i0
|
|
322
322
|
alita_sdk/tools/testio/__init__.py,sha256=-4pEdEv0xfXml5bn8Nij28D5o9Y8hDllYoXfPeJ6os4,2699
|
323
323
|
alita_sdk/tools/testio/api_wrapper.py,sha256=BvmL5h634BzG6p7ajnQLmj-uoAw1gjWnd4FHHu1h--Q,21638
|
324
324
|
alita_sdk/tools/testrail/__init__.py,sha256=0kETjWKLU7R6mugBWsjwEUsh10pipbAeNSGJAO0FBh0,4634
|
325
|
-
alita_sdk/tools/testrail/api_wrapper.py,sha256=
|
325
|
+
alita_sdk/tools/testrail/api_wrapper.py,sha256=xKQbjwL602J55KZiAdMcMtsuzK2jky0DUcrrdsazj0A,32981
|
326
326
|
alita_sdk/tools/utils/__init__.py,sha256=155xepXPr4OEzs2Mz5YnjXcBpxSv1X2eznRUVoPtyK0,3268
|
327
327
|
alita_sdk/tools/utils/available_tools_decorator.py,sha256=IbrdfeQkswxUFgvvN7-dyLMZMyXLiwvX7kgi3phciCk,273
|
328
|
-
alita_sdk/tools/utils/content_parser.py,sha256=
|
328
|
+
alita_sdk/tools/utils/content_parser.py,sha256=VKJAYIRGZqal2OV9fdaKGz3pJIaPcFO6HRXNUQwG6eI,13056
|
329
329
|
alita_sdk/tools/vector_adapters/VectorStoreAdapter.py,sha256=a6FAsiix_EvATIKUf5YT6vHh5LDyJ5uSP3LJqoxFo04,17367
|
330
330
|
alita_sdk/tools/vector_adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
331
331
|
alita_sdk/tools/xray/__init__.py,sha256=AsHDvRgyD-6vvGyAyQDPWHbOD2WoMJ5Llt029bLuu6U,4277
|
@@ -337,7 +337,7 @@ alita_sdk/tools/zephyr/__init__.py,sha256=8B2Ibz5QTmB5WkV0q8Sq4kuj92FFaFWZLrT877
|
|
337
337
|
alita_sdk/tools/zephyr/api_wrapper.py,sha256=lJCYPG03ej0qgdpLflnS7LFB4HSAfGzIvTjAJt07CQs,6244
|
338
338
|
alita_sdk/tools/zephyr/rest_client.py,sha256=7vSD3oYIX-3KbAFed-mphSQif_VRuXrq5O07ryNQ7Pk,6208
|
339
339
|
alita_sdk/tools/zephyr_enterprise/__init__.py,sha256=IoWQPH2lf2Yuj2ejZ74818JTXdrMoh_ZxAJORukYODU,4172
|
340
|
-
alita_sdk/tools/zephyr_enterprise/api_wrapper.py,sha256=
|
340
|
+
alita_sdk/tools/zephyr_enterprise/api_wrapper.py,sha256=JJ3sOf_qEVogqYNdPno0WkJE9MTf0cP29h9oiuWNXDs,11880
|
341
341
|
alita_sdk/tools/zephyr_enterprise/zephyr_enterprise.py,sha256=hV9LIrYfJT6oYp-ZfQR0YHflqBFPsUw2Oc55HwK0H48,6809
|
342
342
|
alita_sdk/tools/zephyr_essential/__init__.py,sha256=2SymL6TIF1ad52w5DTtWaYvNygEvE1ssNNeKx3Y-_Zg,3980
|
343
343
|
alita_sdk/tools/zephyr_essential/api_wrapper.py,sha256=PN8KbNBzbsjgkdpyogav1cmwIwu_6dGh0EA2mAm2U68,40685
|
@@ -347,8 +347,8 @@ alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=HOt9ShtJI_1tVPcwd3Rwk-VS0SMLq
|
|
347
347
|
alita_sdk/tools/zephyr_squad/__init__.py,sha256=0AI_j27xVO5Gk5HQMFrqPTd4uvuVTpiZUicBrdfEpKg,2796
|
348
348
|
alita_sdk/tools/zephyr_squad/api_wrapper.py,sha256=kmw_xol8YIYFplBLWTqP_VKPRhL_1ItDD0_vXTe_UuI,14906
|
349
349
|
alita_sdk/tools/zephyr_squad/zephyr_squad_cloud_client.py,sha256=R371waHsms4sllHCbijKYs90C-9Yu0sSR3N4SUfQOgU,5066
|
350
|
-
alita_sdk-0.3.
|
351
|
-
alita_sdk-0.3.
|
352
|
-
alita_sdk-0.3.
|
353
|
-
alita_sdk-0.3.
|
354
|
-
alita_sdk-0.3.
|
350
|
+
alita_sdk-0.3.287.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
351
|
+
alita_sdk-0.3.287.dist-info/METADATA,sha256=-RGfu1R7sbnkx9BKN2yv6QypQ03uqiUF9h0e6tqz01A,18897
|
352
|
+
alita_sdk-0.3.287.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
353
|
+
alita_sdk-0.3.287.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
354
|
+
alita_sdk-0.3.287.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|