ractogateway.pipelines.agent._executor
Tool registration and execution engine for AgentPipeline.
- ToolExecutor wraps a dict of callables and provides:
Synchronous execution with timing
Async execution (runs sync callables in a thread pool)
Parallel async execution via asyncio.gather
Human-readable tool descriptions for the system prompt
- Built-in tool factories:
make_finish_tool() - Always registered; signals task completion make_rag_tool(rag) - Auto-registered when rag_pipeline is provided make_sql_tool(sql) - Auto-registered when sql_pipeline is provided make_http_tool() - Opt-in; fetches URLs via httpx make_memory_tools(mem) - Auto-registered when agent_memory is provided
- class ractogateway.pipelines.agent._executor.ToolExecutor(tools, max_retries=0)[source]
Bases:
objectRuns registered tools by name with sync and async support.
- Parameters:
- execute(tool_name, tool_input)[source]
Execute tool_name synchronously, retrying up to max_retries times on exception.
- async aexecute(tool_name, tool_input)[source]
Execute tool_name asynchronously, retrying up to max_retries times on exception.
Async callables are awaited directly; sync callables run in the default thread-pool executor to avoid blocking the event loop.
- async aexecute_parallel(calls)[source]
Execute multiple tool calls concurrently via
asyncio.gather.
- ractogateway.pipelines.agent._executor.make_finish_tool()[source]
Return the always-present
finishtool.When the LLM calls
finish(answer=...), the agent loop stops and returns the answer asAgentResult.final_answer.
- ractogateway.pipelines.agent._executor.make_rag_tool(rag_pipeline)[source]
Return a
rag_searchtool backed by aRactoRAGpipeline.
- ractogateway.pipelines.agent._executor.make_rag_tool_async(rag_pipeline)[source]
Return an async
rag_searchtool backed by an asyncRactoRAG.
- ractogateway.pipelines.agent._executor.make_sql_tool(sql_pipeline)[source]
Return a
sql_querytool backed by aSQLAnalystPipeline.
- ractogateway.pipelines.agent._executor.make_http_tool()[source]
Return an
http_gettool that fetches URL content via httpx.Requires
httpx:pip install ractogateway[pipelines-agent-http]