Interface FakeResponseSource

All Known Implementing Classes:
RegistryFakeResponseSource, StaticFakeResponseSource

public interface FakeResponseSource
Supplies scripted responses to a FakeLlmClient. The implementation owns all per-run mutable state: it atomically advances the ordinal counter for the invocation's (runId, workflowId, stepId, agentId) sequence, looks up the resulting FakeScriptKey, and is responsible for per-run isolation and counter lifecycle (eviction). The client is stateless and never computes ordinals.
  • Method Summary

    Modifier and Type
    Method
    Description
    Atomically advances the per-sequence ordinal for this invocation and resolves the response.
  • Method Details

    • nextResponse

      FakeResolution nextResponse(FakeInvocation invocation)
      Atomically advances the per-sequence ordinal for this invocation and resolves the response. Implementations must keep counters isolated per FakeInvocation.runId() so concurrent runs never interleave. When no script is available for the run, no counter is advanced and FakeResolution.RunNotScripted is returned.
      Parameters:
      invocation - the invocation identity (run, workflow, step, agent); never null
      Returns:
      the resolution: a found response, a missing key, or an unscripted run