Why it matters

Unit tests catch regressions cheaply. Mock LLM keeps tests fast.

Advertisement

The architecture

Mock LLM + tools.

Assert prompt + parsing.

Deterministic.

Agent unit testingMock LLMreturn cannedMock toolsreturn cannedAssertprompt + parse + choiceJUnit + Mockito style; pytest for Python; mock everything above framework
Agent unit testing.
Advertisement

How it works end to end

JUnit + Mockito.

pytest + unittest.mock.

Mock LLM and tools.