Agents, Tasks, and Tools
Use this sub-skill for Langroid work centered on:
ChatAgentConfigandChatAgentTaskConfigandTaskToolMessageandXMLToolMessage- orchestration tools such as
DoneTool,ResultTool, andFinalResultTool TaskToolandRecipientTooldone_sequences,handle_llm_no_tool, structured output, batch helpers, andMockLM
Use it when the problem is about agent orchestration, tool wiring, routing, termination, typed output, or deterministic testing. If the issue is about provider endpoints, keys, or model backends, route elsewhere first.
Route elsewhere
- Provider endpoints, keys, or model wiring → llm-provider-config
- RAG, document chat, or retrieval flows → retrieval-doc-chat
- SQL, table, or graph workflows → data-sql-graph-agents
- MCP or Chainlit integrations → integrations-mcp-chainlit
Core pattern
- Pick the right
ToolMessageor output type. - Enable it with
enable_message. - Add a
ChatAgenthandler or tool-levelhandle/responsemethod. - Wrap the agent in a
Task. - Add routing or termination only when needed.
- Test the flow with
MockLMbefore using a provider-backed model.