Interface AiContext
- All Known Subinterfaces:
DesignerAiContext, GatewayAiContext
public interface AiContext
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacePlatform-visible builder returned bynewAgenticHarness(String, String, Agent.AgentFactory).static final recordA specific model from a specific provider. -
Method Summary
Modifier and TypeMethodDescriptionThe default model for this context, if one is configured.All model providers currently registered in this context.default AiContext.HarnessBuildernewAgenticHarness(AiContext.ProvidedModel providedModel, Agent.AgentFactory factory) Convenience overload for callers that already hold aAiContext.ProvidedModel.newAgenticHarness(String providerName, String modelId, Agent.AgentFactory factory)
-
Method Details
-
getModelProviders
List<ModelProviderMetadata> getModelProviders()All model providers currently registered in this context. -
getDefaultModel
Optional<AiContext.ProvidedModel> getDefaultModel() throws ProviderConfigException, UpstreamModelProviderExceptionThe default model for this context, if one is configured.- Returns:
- the default model for this context, or empty when none is configured.
- Throws:
ProviderConfigException- naming the provider, when its own configuration is unusable.UpstreamModelProviderException- when a provider's catalog can't be read.
-
newAgenticHarness
AiContext.HarnessBuilder newAgenticHarness(String providerName, String modelId, Agent.AgentFactory factory) Begin building anAgenticHarnessagainstmodelIdonproviderName. SeeAiContext.HarnessBuilderfor the options the returned builder exposes.The caller owns the built harness and must
closeit: this context holds it strongly, and keeps it in its harness registry, until then.- Throws:
NoSuchElementException- ifproviderNamedoes not match any provider in this context's catalog.
-
newAgenticHarness
default AiContext.HarnessBuilder newAgenticHarness(AiContext.ProvidedModel providedModel, Agent.AgentFactory factory) Convenience overload for callers that already hold aAiContext.ProvidedModel. Delegates tonewAgenticHarness(String, String, AgentFactory).- Throws:
NoSuchElementException- ifprovidedModel.providerName()does not match any provider in this context's catalog.
-