alita-sdk 0.3.137__py3-none-any.whl → 0.3.138__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.
@@ -65,14 +65,22 @@ class AlitaClient:
65
65
  self.configurations: list = configurations or []
66
66
 
67
67
  def get_mcp_toolkits(self):
68
- url = self.mcp_tools_list
69
- data = requests.get(url, headers=self.headers, verify=False).json()
70
- return data
68
+ if user_id := self._get_real_user_id():
69
+ url = f"{self.mcp_tools_list}/{user_id}"
70
+ data = requests.get(url, headers=self.headers, verify=False).json()
71
+ return data
72
+ else:
73
+ return []
74
+
75
+
71
76
 
72
77
  def mcp_tool_call(self, params: dict[str, Any]):
73
- url = self.mcp_tools_call
74
- data = requests.post(url, headers=self.headers, json=params, verify=False).json()
75
- return data
78
+ if user_id := self._get_real_user_id():
79
+ url = f"{self.mcp_tools_call}/{user_id}"
80
+ data = requests.post(url, headers=self.headers, json=params, verify=False).json()
81
+ return data
82
+ else:
83
+ return f"Error: Could not determine user ID for MCP tool call: {e}"
76
84
 
77
85
  def prompt(self, prompt_id, prompt_version_id, chat_history=None, return_tool=False):
78
86
  url = f"{self.prompt_versions}/{prompt_id}/{prompt_version_id}"
@@ -410,3 +418,12 @@ class AlitaClient:
410
418
  content = resp_data["findings"]
411
419
  references = resp_data['references']
412
420
  return AIMessage(content=content, additional_kwargs={"references": references})
421
+
422
+ def _get_real_user_id(self):
423
+ try:
424
+ import tasknode_task
425
+ monitoring_meta = tasknode_task.meta.get("monitoring", {})
426
+ return monitoring_meta["user_id"]
427
+ except Exception as e:
428
+ logger.warning(f"Error: Could not determine user ID for MCP tool: {e}")
429
+ return None
@@ -76,7 +76,7 @@ class AdoAnalyseWrapper(BaseToolApiWrapper):
76
76
 
77
77
  return (
78
78
  f"You have access to {len(result)} project. "
79
- f"Data has been downloaded to the bucket as 'projects_info_AzureDevOps.csv'."
79
+ f"Data has been downloaded to the bucket as 'projects_info.csv'."
80
80
  )
81
81
 
82
82
  @with_streamlit_logs(tool_name="get_work_items")
@@ -85,8 +85,7 @@ class GitLabAnalyseWrapper(BaseToolApiWrapper):
85
85
  f"Data has been downloaded to the bucket as 'gitlab_projects_that_in_Jira.csv'."
86
86
  )
87
87
 
88
- def get_gitlab_commits(self, project_ids: Optional[str], since_date: str,
89
- ) -> str:
88
+ def get_gitlab_commits(self, since_date: str, project_ids: Optional[str] = None) -> str:
90
89
  """
91
90
  Get commit data for specified GitLab project.
92
91
 
@@ -112,7 +111,7 @@ class GitLabAnalyseWrapper(BaseToolApiWrapper):
112
111
  f"Data has been downloaded to the bucket as 'commits_details_{project_ids}.csv'."
113
112
  )
114
113
 
115
- def get_gitlab_merge_requests(self, project_ids: Optional[str], since_date: str) -> str:
114
+ def get_gitlab_merge_requests(self, since_date: str, project_ids: Optional[str] = None) -> str:
116
115
  """
117
116
  Get merge requests for specified GitLab project.
118
117
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alita_sdk
3
- Version: 0.3.137
3
+ Version: 0.3.138
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
  Project-URL: Homepage, https://projectalita.ai
@@ -4,18 +4,18 @@ alita_sdk/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
4
4
  alita_sdk/agents/llamaAgentParser.py,sha256=N_Nw6WJ8xrNX3fr_JFwjUIg_Urai9lLU3poMgZz0Cyk,1701
5
5
  alita_sdk/clients/__init__.py,sha256=5O_7WsZmvg5z5uZf_Jkx-f8j5C6yKIuSwQR6AQ-TM84,31
6
6
  alita_sdk/clients/artifact.py,sha256=W6oLlthtsUHfUWjhihaDdhLZdRVqj1D2j7oHHELxJfs,2639
7
- alita_sdk/clients/client.py,sha256=_-2S7wNZYkr6JgOtJJkUQbFWT_XFYdOt1iAi9BivNEE,18793
7
+ alita_sdk/clients/client.py,sha256=kB1lkvrSNTYWP5EyzZ7JSWcvnVKaRv1mP26gD-qN7dk,19431
8
8
  alita_sdk/clients/datasource.py,sha256=HAZovoQN9jBg0_-lIlGBQzb4FJdczPhkHehAiVG3Wx0,1020
9
9
  alita_sdk/clients/prompt.py,sha256=li1RG9eBwgNK_Qf0qUaZ8QNTmsncFrAL2pv3kbxZRZg,1447
10
10
  alita_sdk/community/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  alita_sdk/community/utils.py,sha256=lvuCJaNqVPHOORJV6kIPcXJcdprVW_TJvERtYAEgpjM,249
12
12
  alita_sdk/community/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  alita_sdk/community/analysis/ado_analyse/__init__.py,sha256=lGlhDwaQB1pqRp9-jR2Y0zLTBMGjao3wJVMi-09XK0g,4108
14
- alita_sdk/community/analysis/ado_analyse/api_wrapper.py,sha256=NEQxZ6Y0g5wwwFhuoD7TYHwEmCrd6ictf8TakoLfQ08,8687
14
+ alita_sdk/community/analysis/ado_analyse/api_wrapper.py,sha256=PaEoynvxaLiwiQEcrdIQj3nFtkKZvvf5K6fZr_ASBkc,8675
15
15
  alita_sdk/community/analysis/github_analyse/__init__.py,sha256=MwHmE6yfunc_h6UmKMqULKxTfMM8dojnpZLbCmdOao0,3602
16
16
  alita_sdk/community/analysis/github_analyse/api_wrapper.py,sha256=Otx1kbDqn0O1phz3qNJ5-0soO9_uU4zZ_YnB0tN6l9w,6826
17
17
  alita_sdk/community/analysis/gitlab_analyse/__init__.py,sha256=yJQKbr78n61cfvBrt95OjFmI_QPAjw-5SAdQL634ftk,4164
18
- alita_sdk/community/analysis/gitlab_analyse/api_wrapper.py,sha256=FZ2StzLH0MtO26guL51wV-ar457ygJtuPEvhqg-IXGM,6333
18
+ alita_sdk/community/analysis/gitlab_analyse/api_wrapper.py,sha256=ZHUC9qm2w7hcots4Rxdv7CEzU17R1X1-8pFnTZxQ_dk,6341
19
19
  alita_sdk/community/analysis/jira_analyse/__init__.py,sha256=Rm-HKEi_HIxrgHdq9mZ-XzxMKLXm8-81eJwJT2lar-c,5945
20
20
  alita_sdk/community/analysis/jira_analyse/api_wrapper.py,sha256=naEgBSdwNonNleUtHCb1UOkWiYdM64ZJ9dfsyszmeX8,9668
21
21
  alita_sdk/community/browseruse/__init__.py,sha256=uAxPZEX7ihpt8HtcGDFrzTNv9WcklT1wG1ItTwUO8y4,3601
@@ -101,13 +101,13 @@ alita_sdk/utils/logging.py,sha256=hBE3qAzmcLMdamMp2YRXwOOK9P4lmNaNhM76kntVljs,31
101
101
  alita_sdk/utils/save_dataframe.py,sha256=tNwnaVCvN4_B0oi3F4Y3Z13elbIRtwKmdKHsMcj658g,1465
102
102
  alita_sdk/utils/streamlit.py,sha256=zp8owZwHI3HZplhcExJf6R3-APtWx-z6s5jznT2hY_k,29124
103
103
  alita_sdk/utils/utils.py,sha256=dM8whOJAuFJFe19qJ69-FLzrUp6d2G-G6L7d4ss2XqM,346
104
- alita_sdk-0.3.137.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
104
+ alita_sdk-0.3.138.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
105
105
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
106
106
  tests/test_ado_analysis.py,sha256=wsxB4B2Ycxoiykthh6YbPQ9hqsDbPFie8D9ZK1i_6kg,3311
107
107
  tests/test_github_analysis.py,sha256=ulR4CEGmiMRPydJuX7aQcglzvhC7kFOAtZRLLBB9F_M,3148
108
108
  tests/test_gitlab_analysis.py,sha256=J7Y2mNi5Sj8-rH2PMRmVbT3uwZ17YeR9pcs0MDIyNW4,3352
109
109
  tests/test_jira_analysis.py,sha256=6F3Elikt02L28N6sS_AKDy9lgqgD81_hr979NcdZeg4,3359
110
- alita_sdk-0.3.137.dist-info/METADATA,sha256=jtSms2_mzUf9ZJ92ctGI_emhFd-Qvwzk_5Uk_XnURrY,7076
111
- alita_sdk-0.3.137.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
- alita_sdk-0.3.137.dist-info/top_level.txt,sha256=SWRhxB7Et3cOy3RkE5hR7OIRnHoo3K8EXzoiNlkfOmc,25
113
- alita_sdk-0.3.137.dist-info/RECORD,,
110
+ alita_sdk-0.3.138.dist-info/METADATA,sha256=J08TBQBFcpWD_V0jC6VWgvIK0KNeyo92aKUwi90HGQM,7076
111
+ alita_sdk-0.3.138.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
112
+ alita_sdk-0.3.138.dist-info/top_level.txt,sha256=SWRhxB7Et3cOy3RkE5hR7OIRnHoo3K8EXzoiNlkfOmc,25
113
+ alita_sdk-0.3.138.dist-info/RECORD,,