File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[project ]
22name = " xfmr-zem"
3- version = " 0.3.8 "
3+ version = " 0.3.9 "
44description = " Zem: Unified Data Pipeline Framework (ZenML + NeMo Curator + DataJuicer) for multi-domain processing"
55readme = " README.md"
66requires-python = " >=3.10,<3.13"
Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ def create_dataset(
7070 guidelines : str = "" ,
7171 api_url : Optional [str ] = None ,
7272 api_key : Optional [str ] = None ,
73- ** kwargs : Any ,
7473) -> Dict [str , Any ]:
7574 """
7675 Tạo hoặc lấy dataset trên Argilla server.
@@ -136,7 +135,6 @@ def push_records(
136135 batch_size : int = 200 ,
137136 api_url : Optional [str ] = None ,
138137 api_key : Optional [str ] = None ,
139- ** kwargs : Any ,
140138) -> Dict [str , Any ]:
141139 """
142140 Đẩy records từ pipeline vào Argilla dataset.
@@ -456,7 +454,6 @@ def annotation_progress(
456454 workspace : str = "admin" ,
457455 api_url : Optional [str ] = None ,
458456 api_key : Optional [str ] = None ,
459- ** kwargs : Any ,
460457) -> Dict [str , Any ]:
461458 """
462459 Thống kê tiến độ annotation của dataset.
@@ -622,7 +619,6 @@ def create_user(
622619 workspace : Optional [str ] = None ,
623620 api_url : Optional [str ] = None ,
624621 api_key : Optional [str ] = None ,
625- ** kwargs : Any ,
626622) -> Dict [str , Any ]:
627623 """
628624 Tạo user mới trên Argilla server.
Original file line number Diff line number Diff line change @@ -195,6 +195,25 @@ def mcp_generic_step(
195195 command = server_config .get ("command" , "python" )
196196 args = server_config .get ("args" , [])
197197 env = server_config .get ("env" , os .environ .copy ())
198+
199+ # Filter tool_args based on tool's inputSchema
200+ try :
201+ tools = list_mcp_tools (command , args , env )
202+ target_tool = next ((t for t in tools if t ["name" ] == tool_name ), None )
203+ if target_tool and "inputSchema" in target_tool :
204+ schema = target_tool ["inputSchema" ]
205+ properties = schema .get ("properties" , {})
206+ valid_keys = set (properties .keys ())
207+
208+ # Filter arguments
209+ original_args = tool_args .copy ()
210+ tool_args = {k : v for k , v in tool_args .items () if k in valid_keys }
211+
212+ removed_keys = set (original_args .keys ()) - valid_keys
213+ if removed_keys :
214+ logger .info (f"[{ server_name } ] Lọc bỏ tham số dư thừa cho '{ tool_name } ': { removed_keys } " )
215+ except Exception as e :
216+ logger .warning (f"[{ server_name } ] Không thể lấy schema để lọc tham số cho '{ tool_name } ': { e } " )
198217
199218 logger .info (f"[{ server_name } ] Executing tool '{ tool_name } '" )
200219 start_time = time .time ()
You can’t perform that action at this time.
0 commit comments