Class LlmRegistry
java.lang.Object
com.google.adk.models.LlmRegistry
Central registry for managing Large Language Model (LLM) instances.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
The factory interface for creating LLM instances. -
Method Summary
Modifier and TypeMethodDescriptionstatic BaseLlm
Returns an LLM instance for the given model name, using a cached or new factory-created instance.static void
registerLlm
(String modelNamePattern, LlmRegistry.LlmFactory factory) Registers a factory for model names matching the given regex pattern.
-
Method Details
-
registerLlm
Registers a factory for model names matching the given regex pattern.- Parameters:
modelNamePattern
- Regex pattern for matching model names.factory
- Factory to create LLM instances.
-
getLlm
Returns an LLM instance for the given model name, using a cached or new factory-created instance.- Parameters:
modelName
- Model name to look up.- Returns:
- Matching
BaseLlm
instance. - Throws:
IllegalArgumentException
- If no factory matches the model name.
-