java.lang.Object
com.agentforge4j.llm.fake.FakeLlmClientFactory
- All Implemented Interfaces:
LlmClientFactory
LlmClientFactory for the fake provider, discovered via ServiceLoader. Requires a
FakeConfiguration (carrying the shared FakeResponseSource); any other configuration type raises an
LlmProviderConfigurationException.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(LlmClientFactoryContext context) Creates a fake client from aLlmClientFactoryContext.Returns the provider id this factory creates clients for.booleanReturnstrueif this provider requires an API key to function.
-
Constructor Details
-
FakeLlmClientFactory
public FakeLlmClientFactory()
-
-
Method Details
-
getProviderName
Description copied from interface:LlmClientFactoryReturns the provider id this factory creates clients for.- Specified by:
getProviderNamein interfaceLlmClientFactory- Returns:
- non-blank provider id such as
"openai"or"ollama"
-
requiresApiKey
public boolean requiresApiKey()Description copied from interface:LlmClientFactoryReturnstrueif this provider requires an API key to function. Providers that run locally without authentication (e.g. Ollama, vLLM) should override this to returnfalse.Used by the bootstrap module to determine whether to include a provider when no explicit API key is configured.
- Specified by:
requiresApiKeyin interfaceLlmClientFactory- Returns:
trueif an API key is required;falseotherwise
-
create
Creates a fake client from aLlmClientFactoryContext. The fake provider's load-bearing input is aFakeResponseSource, which cannot be expressed as neutral string options, so it must be supplied programmatically as aFakeConfiguration(viawithLlmProvider) — the neutral env/system-property path cannot configure it.- Specified by:
createin interfaceLlmClientFactory- Parameters:
context- the factory inputs- Returns:
- a new fake LLM client
- Throws:
LlmProviderConfigurationException- if the configuration is not aFakeConfiguration
-