Annotation Interface AiProvider.ModelConfig
- Enclosing class:
AiProvider
Annotation used to define a configuration for a specific LangChain4j model class.
This configuration is used during code generation for creating service bean providers
and configuration blueprints.
Configuration example:
Configuration example:
langchain4j:
# provider key
open-ai:
# model type
chat-model:
# properties introspected from
api-key: api-key
model-name: model-name
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass
<?> Specifies the builder class associated with the LangChain4j model, for configuration introspection.Specifies a unique configuration key to identify the service provider for the associated LangChain4j model.String[]
Specifies property names or configurations to skip in the configuration blueprint.double
Defines the weight of the generated model factory bean.
-
Element Details
-
value
Class<?> valueLangChain4j model class to be introspected for code-generated service bean providers.- Returns:
- LangChain4j model class
-
builder
Class<?> builderSpecifies the builder class associated with the LangChain4j model, for configuration introspection.- Returns:
- the builder class, or
Void.class
if no builder is specified.
- Default:
java.lang.Void.class
-
skip
String[] skipSpecifies property names or configurations to skip in the configuration blueprint.- Returns:
- an array of property names or configurations to exclude
- Default:
{}
-
providerKey
String providerKeySpecifies a unique configuration key to identify the service provider for the associated LangChain4j model. If not specified, key is derived from the configuration parent class, example:OpenAiConfiguration.java
->open-ai
- Returns:
- the unique provider key, or an empty string if not specified.
- Default:
""
-
weight
double weightDefines the weight of the generated model factory bean. A higher weight indicates higher significance.- Returns:
- the weight value, default is
Weighted.DEFAULT_WEIGHT
in no constant of thedouble
type is defined and annotated withAiProvider.DefaultWeight
in the same class.
- Default:
100.0
-