MCPcopy Index your code
hub / github.com/1Panel-dev/MaxKB / debug

Method debug

apps/tools/serializers/tool.py:566–590  ·  view source on GitHub ↗
(self, debug_instance)

Source from the content-addressed store, hash-verified

564 workspace_id = serializers.CharField(required=True, label=_("workspace id"))
565
566 def debug(self, debug_instance):
567 self.is_valid(raise_exception=True)
568 ToolDebugRequest(data=debug_instance).is_valid(raise_exception=True)
569 input_field_list = debug_instance.get("input_field_list")
570 code = debug_instance.get("code")
571 debug_field_list = debug_instance.get("debug_field_list")
572 init_params = debug_instance.get("init_params")
573 params = {
574 field.get("name"): self.convert_value(
575 field.get("name"), field.get("value"), field.get("type"), field.get("is_required")
576 )
577 for field in [
578 {
579 "value": self.get_field_value(debug_field_list, field.get("name"), field.get("is_required")),
580 **field,
581 }
582 for field in input_field_list
583 ]
584 }
585 # 合并初始化参数
586 if init_params is not None:
587 all_params = init_params | params
588 else:
589 all_params = params
590 return tool_executor.exec_code(code, all_params)
591
592 @staticmethod
593 def get_field_value(debug_field_list, name, is_required):

Callers 15

postMethod · 0.45
postMethod · 0.45
handle_task_startMethod · 0.45
handle_task_endMethod · 0.45
on_app_readyFunction · 0.45
enable_force_gcFunction · 0.45
executeMethod · 0.45
_upsert_fragmentFunction · 0.45
_yield_mcp_responseFunction · 0.45
exec_codeMethod · 0.45
get_tool_mcp_configMethod · 0.45

Calls 6

convert_valueMethod · 0.95
get_field_valueMethod · 0.95
ToolDebugRequestClass · 0.85
exec_codeMethod · 0.80
is_validMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected