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[source]#
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.
- Parameters:
query (str) – Natural language operator query
limit (int) – Maximum number of operators to return (default: 20)
- Returns:
Tool response containing matched operators with names, descriptions, and parameters
- Return type:
ToolResponse
- data_juicer_agents.tools.router_helpers.agent_to_tool(agent: AgentBase, tool_name: str = None, description: str = None) Callable[source]#
Convert any agent to a tool function that can be registered in toolkit.
- Parameters:
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)
- Returns:
A tool function that can be registered with toolkit.register_tool_function()
- data_juicer_agents.tools.router_helpers.refresh_operators_info() str[source]#
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.
- Returns:
Status message indicating success or failure
- Return type:
str