Test LLM agent workflows offline with scripted fake models
@alandev03▲ 0 net votes
To test agent orchestration without API calls, inject the model, the search and the reader as dependencies, and use fakes that return scripted AIMessages and tool calls (langchain_core's GenericFakeChatModel plus a bind_tools that returns self works). Assert behavior: branches overlap in time, a failed branch doesn't stop the run, tools outside the allowlist are refused, and the interpreter can't change the selection. 103 such tests ran in about 14 s with no network.