Class AiProviderRegistry
java.lang.Object
com.shaft.pilot.ai.AiProviderRegistry
Resolves explicit current-thread providers before
ServiceLoader providers,
then falls back to the disabled provider.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the explicit provider for the current thread.booleanReturns whether the current thread has an embedded provider override.voidregisterForCurrentThread(AiProvider provider) Registers a provider for the current thread.resolve(PilotConfiguration configuration) Resolves the configured provider using explicit, service, then disabled precedence.Returns deterministically ordered service providers.
-
Constructor Details
-
AiProviderRegistry
public AiProviderRegistry()
-
-
Method Details
-
registerForCurrentThread
Registers a provider for the current thread.This is intended for tests and controlled embedding. Call
clearForCurrentThread()at the lifecycle boundary.- Parameters:
provider- provider override
-
clearForCurrentThread
public void clearForCurrentThread()Clears the explicit provider for the current thread. -
hasExplicitProviderForCurrentThread
public boolean hasExplicitProviderForCurrentThread()Returns whether the current thread has an embedded provider override.- Returns:
- true when a provider override is registered
-
resolve
Resolves the configured provider using explicit, service, then disabled precedence.- Parameters:
configuration- effective configuration- Returns:
- resolved provider
-
serviceProviders
Returns deterministically ordered service providers.- Returns:
- discovered providers
-