java.lang.Object
com.agentforge4j.llm.fake.RegistryFakeResponseSource
- All Implemented Interfaces:
FakeResponseSource
The read face of a
FakeRunLifecycle: resolves responses against scripts explicitly registered per run. The
same FakeRunLifecycle instance is the write/lifecycle face (register/deregister/sweep) handed to the test
runner or demo flow, so the client and the registration API share one per-run store.
When a run has no registered script, nextResponse(FakeInvocation) returns
FakeResolution.RunNotScripted.
-
Constructor Summary
ConstructorsConstructorDescriptionRegistryFakeResponseSource(FakeRunLifecycle lifecycle) Creates a source backed by the given lifecycle store. -
Method Summary
Modifier and TypeMethodDescriptionnextResponse(FakeInvocation invocation) Atomically advances the per-sequence ordinal for this invocation and resolves the response.
-
Constructor Details
-
RegistryFakeResponseSource
Creates a source backed by the given lifecycle store.- Parameters:
lifecycle- the shared per-run store; must not benull
-
-
Method Details
-
nextResponse
Description copied from interface:FakeResponseSourceAtomically advances the per-sequence ordinal for this invocation and resolves the response. Implementations must keep counters isolated perFakeInvocation.runId()so concurrent runs never interleave. When no script is available for the run, no counter is advanced andFakeResolution.RunNotScriptedis returned.- Specified by:
nextResponsein interfaceFakeResponseSource- Parameters:
invocation- the invocation identity (run, workflow, step, agent); nevernull- Returns:
- the resolution: a found response, a missing key, or an unscripted run
-