java.lang.Object
com.agentforge4j.llm.fake.FakeLlmClient
- All Implemented Interfaces:
LlmClient
Stateless
LlmClient that replays pre-scripted responses instead of calling a model. It holds only its
FakeResponseSource; all per-run state (scripts and ordinal counters) lives in the source's store, so a single
instance safely serves concurrent runs.
Keying: the response is selected by the request's LlmInvocationIdentity
(workflowId, runId, stepId, agentId) plus a per-sequence ordinal the source advances.
Every resolution failure is fail-closed via FakeResponseNotFoundException; the fake never fabricates a
default.
-
Constructor Summary
ConstructorsConstructorDescriptionFakeLlmClient(FakeResponseSource responseSource) Creates a client backed by the given response source. -
Method Summary
Modifier and TypeMethodDescriptionexecute(LlmExecutionRequest request) Executes an LLM request and returns the response.Returns the provider id this client executes against (lowercase, such as"openai").Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.agentforge4j.llm.api.LlmClient
getRetryPolicy
-
Constructor Details
-
FakeLlmClient
Creates a client backed by the given response source.- Parameters:
responseSource- the scripted response source; must not benull
-
-
Method Details
-
getProviderName
Description copied from interface:LlmClientReturns the provider id this client executes against (lowercase, such as"openai").- Specified by:
getProviderNamein interfaceLlmClient- Returns:
- non-blank provider id
-
execute
Description copied from interface:LlmClientExecutes an LLM request and returns the response.
-