alita-sdk 0.3.158__py3-none-any.whl → 0.3.159__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/clients/artifact.py +2 -2
- alita_sdk/runtime/langchain/assistant.py +2 -2
- alita_sdk/runtime/toolkits/tools.py +1 -1
- alita_sdk/runtime/tools/artifact.py +5 -2
- alita_sdk/tools/__init__.py +6 -1
- alita_sdk/tools/memory/__init__.py +7 -0
- alita_sdk/tools/utils/content_parser.py +16 -6
- {alita_sdk-0.3.158.dist-info → alita_sdk-0.3.159.dist-info}/METADATA +4 -3
- {alita_sdk-0.3.158.dist-info → alita_sdk-0.3.159.dist-info}/RECORD +12 -12
- {alita_sdk-0.3.158.dist-info → alita_sdk-0.3.159.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.158.dist-info → alita_sdk-0.3.159.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.158.dist-info → alita_sdk-0.3.159.dist-info}/top_level.txt +0 -0
@@ -24,7 +24,7 @@ class Artifact:
|
|
24
24
|
logger.error(f"Error: {e}")
|
25
25
|
return f"Error: {e}"
|
26
26
|
|
27
|
-
def get(self, artifact_name: str, bucket_name: str = None, is_capture_image: bool = False, page_number: int = None):
|
27
|
+
def get(self, artifact_name: str, bucket_name: str = None, is_capture_image: bool = False, page_number: int = None, sheet_name: str = None):
|
28
28
|
if not bucket_name:
|
29
29
|
bucket_name = self.bucket_name
|
30
30
|
data = self.client.download_artifact(bucket_name, artifact_name)
|
@@ -37,7 +37,7 @@ class Artifact:
|
|
37
37
|
if detected['encoding'] is not None:
|
38
38
|
return data.decode(detected['encoding'])
|
39
39
|
else:
|
40
|
-
return parse_file_content(artifact_name, data, is_capture_image, page_number)
|
40
|
+
return parse_file_content(artifact_name, data, is_capture_image, page_number, sheet_name)
|
41
41
|
|
42
42
|
def delete(self, artifact_name: str, bucket_name = None):
|
43
43
|
if not bucket_name:
|
@@ -61,8 +61,8 @@ class Assistant:
|
|
61
61
|
"Review toolkits configuration or use pipeline as master agent.")
|
62
62
|
|
63
63
|
# configure memory store if memory tool is defined
|
64
|
-
|
65
|
-
|
64
|
+
memory_tool = next((tool for tool in data['tools'] if tool['type'] == 'memory'), None)
|
65
|
+
self._configure_store(memory_tool)
|
66
66
|
|
67
67
|
# Lazy import to avoid circular dependency
|
68
68
|
from ..toolkits.tools import get_tools
|
@@ -94,7 +94,7 @@ def get_tools(tools_list: list, alita_client, llm, memory_store: BaseStore = Non
|
|
94
94
|
# Add community tools
|
95
95
|
tools += community_tools(tools_list, alita_client, llm)
|
96
96
|
# Add alita tools
|
97
|
-
tools += alita_tools(tools_list, alita_client, llm)
|
97
|
+
tools += alita_tools(tools_list, alita_client, llm, memory_store)
|
98
98
|
# Add MCP tools
|
99
99
|
tools += _mcp_tools(tools_list, alita_client)
|
100
100
|
|
@@ -23,8 +23,8 @@ class ArtifactWrapper(BaseToolApiWrapper):
|
|
23
23
|
def create_file(self, filename: str, filedata: str, bucket_name = None):
|
24
24
|
return self.artifact.create(filename, filedata, bucket_name)
|
25
25
|
|
26
|
-
def read_file(self, filename: str, bucket_name = None, is_capture_image: bool = False, page_number: int = None):
|
27
|
-
return self.artifact.get(filename, bucket_name, is_capture_image, page_number)
|
26
|
+
def read_file(self, filename: str, bucket_name = None, is_capture_image: bool = False, page_number: int = None, sheet_name: str = None):
|
27
|
+
return self.artifact.get(filename, bucket_name, is_capture_image, page_number, sheet_name)
|
28
28
|
|
29
29
|
def delete_file(self, filename: str, bucket_name = None):
|
30
30
|
return self.artifact.delete(filename, bucket_name)
|
@@ -75,6 +75,9 @@ class ArtifactWrapper(BaseToolApiWrapper):
|
|
75
75
|
default=False)),
|
76
76
|
page_number=(Optional[int], Field(
|
77
77
|
description="Specifies which page to read. If it is None, then full document will be read.",
|
78
|
+
default=None)),
|
79
|
+
sheet_name=(Optional[str], Field(
|
80
|
+
description="Specifies which sheet to read. If it is None, then full document will be read.",
|
78
81
|
default=None))
|
79
82
|
)
|
80
83
|
},
|
alita_sdk/tools/__init__.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
import logging
|
2
2
|
from importlib import import_module
|
3
|
+
from typing import Optional
|
4
|
+
|
5
|
+
from langgraph.store.base import BaseStore
|
3
6
|
|
4
7
|
logger = logging.getLogger(__name__)
|
5
8
|
|
@@ -74,13 +77,14 @@ _safe_import_tool('carrier', 'carrier', 'get_tools', 'AlitaCarrierToolkit')
|
|
74
77
|
_safe_import_tool('ocr', 'ocr', 'get_tools', 'OCRToolkit')
|
75
78
|
_safe_import_tool('pptx', 'pptx', 'get_tools', 'PPTXToolkit')
|
76
79
|
_safe_import_tool('postman', 'postman', 'get_tools', 'PostmanToolkit')
|
80
|
+
_safe_import_tool('memory', 'memory', 'get_tools', 'MemoryToolkit')
|
77
81
|
|
78
82
|
# Log import summary
|
79
83
|
available_count = len(AVAILABLE_TOOLS)
|
80
84
|
total_attempted = len(AVAILABLE_TOOLS) + len(FAILED_IMPORTS)
|
81
85
|
logger.info(f"Tool imports completed: {available_count}/{total_attempted} successful")
|
82
86
|
|
83
|
-
def get_tools(tools_list, alita, llm, *args, **kwargs):
|
87
|
+
def get_tools(tools_list, alita, llm, store: Optional[BaseStore] = None, *args, **kwargs):
|
84
88
|
tools = []
|
85
89
|
for tool in tools_list:
|
86
90
|
# validate tool name syntax - it cannot be started with _
|
@@ -90,6 +94,7 @@ def get_tools(tools_list, alita, llm, *args, **kwargs):
|
|
90
94
|
|
91
95
|
tool['settings']['alita'] = alita
|
92
96
|
tool['settings']['llm'] = llm
|
97
|
+
tool['settings']['store'] = store
|
93
98
|
tool_type = tool['type']
|
94
99
|
|
95
100
|
# Check if tool is available and has get_tools function
|
@@ -15,6 +15,13 @@ from pydantic import create_model, BaseModel, ConfigDict, Field, SecretStr
|
|
15
15
|
|
16
16
|
name = "memory"
|
17
17
|
|
18
|
+
def get_tools(tool):
|
19
|
+
return MemoryToolkit().get_toolkit(
|
20
|
+
namespace=tool['settings'].get('namespace', str(tool['id'])),
|
21
|
+
store=tool['settings'].get('store', None),
|
22
|
+
toolkit_name=tool.get('toolkit_name', '')
|
23
|
+
).get_tools()
|
24
|
+
|
18
25
|
class MemoryToolkit(BaseToolkit):
|
19
26
|
tools: List[BaseTool] = []
|
20
27
|
|
@@ -9,13 +9,13 @@ import pymupdf
|
|
9
9
|
from langchain_core.tools import ToolException
|
10
10
|
from transformers import BlipProcessor, BlipForConditionalGeneration
|
11
11
|
|
12
|
-
def parse_file_content(file_name, file_content, is_capture_image: bool = False, page_number: int = None):
|
12
|
+
def parse_file_content(file_name, file_content, is_capture_image: bool = False, page_number: int = None, sheet_name: str = None):
|
13
13
|
if file_name.endswith('.txt'):
|
14
14
|
return parse_txt(file_content)
|
15
15
|
elif file_name.endswith('.docx'):
|
16
16
|
return read_docx_from_bytes(file_content)
|
17
17
|
elif file_name.endswith('.xlsx') or file_name.endswith('.xls'):
|
18
|
-
return parse_excel(file_content)
|
18
|
+
return parse_excel(file_content, sheet_name)
|
19
19
|
elif file_name.endswith('.pdf'):
|
20
20
|
return parse_pdf(file_content, page_number, is_capture_image)
|
21
21
|
elif file_name.endswith('.pptx'):
|
@@ -30,15 +30,25 @@ def parse_txt(file_content):
|
|
30
30
|
except Exception as e:
|
31
31
|
return ToolException(f"Error decoding file content: {e}")
|
32
32
|
|
33
|
-
def parse_excel(file_content):
|
33
|
+
def parse_excel(file_content, sheet_name = None):
|
34
34
|
try:
|
35
35
|
excel_file = io.BytesIO(file_content)
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
if sheet_name:
|
37
|
+
return parse_sheet(excel_file, sheet_name)
|
38
|
+
dfs = pd.read_excel(excel_file, sheet_name=sheet_name)
|
39
|
+
result = []
|
40
|
+
for sheet_name, df in dfs.items():
|
41
|
+
df.fillna('', inplace=True)
|
42
|
+
result.append(f"=== Sheet: {sheet_name} ===\n{df.to_string(index=False)}")
|
43
|
+
return "\n\n".join(result)
|
39
44
|
except Exception as e:
|
40
45
|
return ToolException(f"Error reading Excel file: {e}")
|
41
46
|
|
47
|
+
def parse_sheet(excel_file, sheet_name):
|
48
|
+
df = pd.read_excel(excel_file, sheet_name=sheet_name)
|
49
|
+
df.fillna('', inplace=True)
|
50
|
+
return df.to_string()
|
51
|
+
|
42
52
|
def parse_pdf(file_content, page_number, is_capture_image):
|
43
53
|
with pymupdf.open(stream=file_content, filetype="pdf") as report:
|
44
54
|
text_content = ''
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: alita_sdk
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.159
|
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>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -31,8 +31,8 @@ Requires-Dist: langchain_community~=0.3.7; extra == "runtime"
|
|
31
31
|
Requires-Dist: langchain-openai~=0.3.0; extra == "runtime"
|
32
32
|
Requires-Dist: langgraph-checkpoint-sqlite~=2.0.0; extra == "runtime"
|
33
33
|
Requires-Dist: langgraph-checkpoint-postgres~=2.0.1; extra == "runtime"
|
34
|
-
Requires-Dist: langsmith
|
35
|
-
Requires-Dist: langgraph
|
34
|
+
Requires-Dist: langsmith>=0.3.45; extra == "runtime"
|
35
|
+
Requires-Dist: langgraph>=0.4.8; extra == "runtime"
|
36
36
|
Requires-Dist: langchain_chroma~=0.2.2; extra == "runtime"
|
37
37
|
Requires-Dist: langchain-unstructured~=0.1.6; extra == "runtime"
|
38
38
|
Requires-Dist: langchain-postgres~=0.0.13; extra == "runtime"
|
@@ -122,6 +122,7 @@ Requires-Dist: yagmail==0.15.293; extra == "tools"
|
|
122
122
|
Requires-Dist: pysnc==1.1.10; extra == "tools"
|
123
123
|
Requires-Dist: shortuuid==1.0.13; extra == "tools"
|
124
124
|
Requires-Dist: yarl==1.17.1; extra == "tools"
|
125
|
+
Requires-Dist: langmem==0.0.27; extra == "tools"
|
125
126
|
Provides-Extra: community
|
126
127
|
Requires-Dist: retry-extended==0.2.3; extra == "community"
|
127
128
|
Requires-Dist: browser-use==0.1.43; extra == "community"
|
@@ -43,12 +43,12 @@ alita_sdk/community/deep_researcher/utils/md_to_pdf.py,sha256=EgCaUGLsP5-5F301aB
|
|
43
43
|
alita_sdk/community/deep_researcher/utils/os.py,sha256=Q1xX7c7_p7EmuzzXIAY9TDmraDNvU0GGcpfgIfWKQ2A,793
|
44
44
|
alita_sdk/runtime/__init__.py,sha256=4W0UF-nl3QF2bvET5lnah4o24CoTwSoKXhuN0YnwvEE,828
|
45
45
|
alita_sdk/runtime/clients/__init__.py,sha256=BdehU5GBztN1Qi1Wul0cqlU46FxUfMnI6Vq2Zd_oq1M,296
|
46
|
-
alita_sdk/runtime/clients/artifact.py,sha256=
|
46
|
+
alita_sdk/runtime/clients/artifact.py,sha256=4N2t5x3GibyXLq3Fvrv2o_VA7Z000yNfc-UN4eGsHZg,2679
|
47
47
|
alita_sdk/runtime/clients/client.py,sha256=jbC_M72CybwZgFfMRL6paj-NmICrSuk1vVnVTm_u-kc,19734
|
48
48
|
alita_sdk/runtime/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
|
49
49
|
alita_sdk/runtime/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
|
50
50
|
alita_sdk/runtime/langchain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
51
|
-
alita_sdk/runtime/langchain/assistant.py,sha256=
|
51
|
+
alita_sdk/runtime/langchain/assistant.py,sha256=QJEMiEOrFMJ4GpnK24U2pKFblrvdQpKFdfhZsI2wAUI,7507
|
52
52
|
alita_sdk/runtime/langchain/chat_message_template.py,sha256=kPz8W2BG6IMyITFDA5oeb5BxVRkHEVZhuiGl4MBZKdc,2176
|
53
53
|
alita_sdk/runtime/langchain/constants.py,sha256=eHVJ_beJNTf1WJo4yq7KMK64fxsRvs3lKc34QCXSbpk,3319
|
54
54
|
alita_sdk/runtime/langchain/indexer.py,sha256=0ENHy5EOhThnAiYFc7QAsaTNp9rr8hDV_hTK8ahbatk,37592
|
@@ -102,12 +102,12 @@ alita_sdk/runtime/toolkits/artifact.py,sha256=7fTr9VpGd2zwCB3EwW4aqWa5jVKRTunqV3
|
|
102
102
|
alita_sdk/runtime/toolkits/datasource.py,sha256=qk78OdPoReYPCWwahfkKLbKc4pfsu-061oXRryFLP6I,2498
|
103
103
|
alita_sdk/runtime/toolkits/prompt.py,sha256=WIpTkkVYWqIqOWR_LlSWz3ug8uO9tm5jJ7aZYdiGRn0,1192
|
104
104
|
alita_sdk/runtime/toolkits/subgraph.py,sha256=ZYqI4yVLbEPAjCR8dpXbjbL2ipX598Hk3fL6AgaqFD4,1758
|
105
|
-
alita_sdk/runtime/toolkits/tools.py,sha256=
|
105
|
+
alita_sdk/runtime/toolkits/tools.py,sha256=iDWnGpEnmiD226osSlMy7l5suUxOl6vDo8BTtzb8oCw,6128
|
106
106
|
alita_sdk/runtime/toolkits/vectorstore.py,sha256=BGppQADa1ZiLO17fC0uCACTTEvPHlodEDYEzUcBRbAA,2901
|
107
107
|
alita_sdk/runtime/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
108
108
|
alita_sdk/runtime/tools/agent.py,sha256=m98QxOHwnCRTT9j18Olbb5UPS8-ZGeQaGiUyZJSyFck,3162
|
109
109
|
alita_sdk/runtime/tools/application.py,sha256=7XSqwASZGihvQ9uZxnQp61ypFT6twrzBH_BIFC1cX0w,2785
|
110
|
-
alita_sdk/runtime/tools/artifact.py,sha256
|
110
|
+
alita_sdk/runtime/tools/artifact.py,sha256=ILpRclmyHCqz1Byb0zV9LBzI6r9YooNq7-2EYQZCTxU,6412
|
111
111
|
alita_sdk/runtime/tools/datasource.py,sha256=pvbaSfI-ThQQnjHG-QhYNSTYRnZB0rYtZFpjCfpzxYI,2443
|
112
112
|
alita_sdk/runtime/tools/echo.py,sha256=spw9eCweXzixJqHnZofHE1yWiSUa04L4VKycf3KCEaM,486
|
113
113
|
alita_sdk/runtime/tools/function.py,sha256=ZFpd7TGwIawze2e7BHlKwP0NHwNw42wwrmmnXyJQJhk,2600
|
@@ -129,7 +129,7 @@ alita_sdk/runtime/utils/logging.py,sha256=svPyiW8ztDfhqHFITv5FBCj8UhLxz6hWcqGIY6
|
|
129
129
|
alita_sdk/runtime/utils/save_dataframe.py,sha256=i-E1wp-t4wb17Zq3nA3xYwgSILjoXNizaQAA9opWvxY,1576
|
130
130
|
alita_sdk/runtime/utils/streamlit.py,sha256=z4J_bdxkA0zMROkvTB4u379YBRFCkKh-h7PD8RlnZWQ,85644
|
131
131
|
alita_sdk/runtime/utils/utils.py,sha256=dM8whOJAuFJFe19qJ69-FLzrUp6d2G-G6L7d4ss2XqM,346
|
132
|
-
alita_sdk/tools/__init__.py,sha256=
|
132
|
+
alita_sdk/tools/__init__.py,sha256=F1Mrl8jEUUnmfg_VwrNcVSwJKPBp-xmh9vv9goPRA0o,9933
|
133
133
|
alita_sdk/tools/elitea_base.py,sha256=NQaIxPX6DVIerHCb18jwUR6maZxxk73NZaTsFHkBQWE,21119
|
134
134
|
alita_sdk/tools/ado/__init__.py,sha256=mD6GHcYMTtffPJkJvFPe2rzvye_IRmXmWfI7xYuZhO4,912
|
135
135
|
alita_sdk/tools/ado/utils.py,sha256=PTCludvaQmPLakF2EbCGy66Mro4-rjDtavVP-xcB2Wc,1252
|
@@ -248,7 +248,7 @@ alita_sdk/tools/llm/llm_utils.py,sha256=v3_lWP_Nk6tJLkj0BYohOun0OWNfvzqLjPdPAMl-
|
|
248
248
|
alita_sdk/tools/localgit/__init__.py,sha256=NScO0Eu-wl-rc63jjD5Qv1RXXB1qukSIJXx-yS_JQLI,2529
|
249
249
|
alita_sdk/tools/localgit/local_git.py,sha256=gsAftNcK7nMCd8VsIkwDLs2SoG0MgpYdkQG5tmoynkA,18074
|
250
250
|
alita_sdk/tools/localgit/tool.py,sha256=It_B24rMvFPurB355Oy5IShg2BsZTASsEoSS8hu2SXw,998
|
251
|
-
alita_sdk/tools/memory/__init__.py,sha256=
|
251
|
+
alita_sdk/tools/memory/__init__.py,sha256=SOB5Lhf8v8v0-IDUXUgb1KNdv5je-ooi6oGor8iYPpI,2148
|
252
252
|
alita_sdk/tools/ocr/__init__.py,sha256=pvslKVXyJmK0q23FFDNieuc7RBIuzNXTjTNj-GqhGb0,3335
|
253
253
|
alita_sdk/tools/ocr/api_wrapper.py,sha256=08UF8wj1sR8DcW0z16pw19bgLatLkBF8dySW-Ds8iRk,29649
|
254
254
|
alita_sdk/tools/ocr/text_detection.py,sha256=1DBxt54r3_HdEi93QynSIVta3rH3UpIvy799TPtDTtk,23825
|
@@ -303,7 +303,7 @@ alita_sdk/tools/testio/api_wrapper.py,sha256=BvmL5h634BzG6p7ajnQLmj-uoAw1gjWnd4F
|
|
303
303
|
alita_sdk/tools/testrail/__init__.py,sha256=83G9oS2fSiATLnW9783LqdoDyubgnmABEk-1hQcsTGE,3805
|
304
304
|
alita_sdk/tools/testrail/api_wrapper.py,sha256=QkF1j2QIdtqeWUZB0GYtdmKATu0gPTQVmM5faK-ASaI,24495
|
305
305
|
alita_sdk/tools/utils/__init__.py,sha256=155xepXPr4OEzs2Mz5YnjXcBpxSv1X2eznRUVoPtyK0,3268
|
306
|
-
alita_sdk/tools/utils/content_parser.py,sha256
|
306
|
+
alita_sdk/tools/utils/content_parser.py,sha256=cdAENBS2-KPBAVbUczsuT-YJEdouKQ0SxCU6bWFfgak,4736
|
307
307
|
alita_sdk/tools/xray/__init__.py,sha256=dn-Ine9mHF8c_yZ-pWkn-gvSvSmGwdrqxPJOz6Cmqc4,3297
|
308
308
|
alita_sdk/tools/xray/api_wrapper.py,sha256=l7Cwvh_5bEaH0IM3yLo1PSClqV1E20wH_sEHaJntM3s,8517
|
309
309
|
alita_sdk/tools/yagmail/__init__.py,sha256=c4Qn3em0tLxzRmFKpzbBgY9W2EnOoKf0azoDJHng5CY,2208
|
@@ -317,8 +317,8 @@ alita_sdk/tools/zephyr_enterprise/api_wrapper.py,sha256=Ir3zHljhbZQJRJJQOBzS_GL5
|
|
317
317
|
alita_sdk/tools/zephyr_enterprise/zephyr_enterprise.py,sha256=hV9LIrYfJT6oYp-ZfQR0YHflqBFPsUw2Oc55HwK0H48,6809
|
318
318
|
alita_sdk/tools/zephyr_scale/__init__.py,sha256=2NTcdrfkx4GSegqyXhsPLsEpc4FlACuDy85b0fk6cAo,4572
|
319
319
|
alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=UHVQUVqcBc3SZvDfO78HSuBzwAsRw2cCDQa-xMOzndE,68663
|
320
|
-
alita_sdk-0.3.
|
321
|
-
alita_sdk-0.3.
|
322
|
-
alita_sdk-0.3.
|
323
|
-
alita_sdk-0.3.
|
324
|
-
alita_sdk-0.3.
|
320
|
+
alita_sdk-0.3.159.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
321
|
+
alita_sdk-0.3.159.dist-info/METADATA,sha256=C4uRfDlRMstPa_EMg1hsUN1lHDkB80Xnme6REnRJ_Yk,18714
|
322
|
+
alita_sdk-0.3.159.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
323
|
+
alita_sdk-0.3.159.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
324
|
+
alita_sdk-0.3.159.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|