data_juicer_agents.tools.router_helpers module#

Router agent using implicit routing

async data_juicer_agents.tools.router_helpers.query_dj_operators(query: str, limit: int = 20) ToolResponse[源代码]#

Query DataJuicer operators by natural language description.

Retrieves relevant operators from DataJuicer library based on user query. Supports matching by functionality, data type, and processing scenarios.

参数:
  • query (str) -- Natural language operator query

  • limit (int) -- Maximum number of operators to return (default: 20)

返回:

Tool response containing matched operators with names, descriptions, and parameters

返回类型:

ToolResponse

data_juicer_agents.tools.router_helpers.agent_to_tool(agent: AgentBase, tool_name: str = None, description: str = None) Callable[源代码]#

Convert any agent to a tool function that can be registered in toolkit.

参数:
  • agent -- The agent instance to convert

  • tool_name -- Optional custom tool name (defaults to agent.name)

  • description -- Optional tool description (defaults to agent's docstring or sys_prompt)

返回:

A tool function that can be registered with toolkit.register_tool_function()

data_juicer_agents.tools.router_helpers.refresh_operators_info() str[源代码]#

Refresh DataJuicer operators information during runtime.

This function should be called when new operators are developed or when the operator library needs to be updated during the agent's lifecycle.

返回:

Status message indicating success or failure

返回类型:

str