AI rule node: support top K for Google AI Gemini, Google Vertex AI Gemini and Anthropic
This commit is contained in:
parent
afb0259010
commit
72db8f9823
@ -87,6 +87,7 @@ class Langchain4jChatModelConfigurerImpl implements Langchain4jChatModelConfigur
|
||||
.modelName(modelConfig.modelId())
|
||||
.temperature(modelConfig.temperature())
|
||||
.topP(modelConfig.topP())
|
||||
.topK(modelConfig.topK())
|
||||
.timeout(toDuration(modelConfig.timeoutSeconds()))
|
||||
.maxRetries(modelConfig.maxRetries())
|
||||
.build();
|
||||
@ -149,6 +150,9 @@ class Langchain4jChatModelConfigurerImpl implements Langchain4jChatModelConfigur
|
||||
if (modelConfig.topP() != null) {
|
||||
generationConfigBuilder.setTopP(modelConfig.topP().floatValue());
|
||||
}
|
||||
if (modelConfig.topK() != null) {
|
||||
generationConfigBuilder.setTopK(modelConfig.topK());
|
||||
}
|
||||
var generationConfig = generationConfigBuilder.build();
|
||||
|
||||
// construct generative model instance
|
||||
@ -186,6 +190,7 @@ class Langchain4jChatModelConfigurerImpl implements Langchain4jChatModelConfigur
|
||||
.modelName(modelConfig.modelId())
|
||||
.temperature(modelConfig.temperature())
|
||||
.topP(modelConfig.topP())
|
||||
.topK(modelConfig.topK())
|
||||
.timeout(toDuration(modelConfig.timeoutSeconds()))
|
||||
.maxRetries(modelConfig.maxRetries())
|
||||
.build();
|
||||
|
||||
@ -31,6 +31,7 @@ public record AnthropicChatModel(
|
||||
String modelId,
|
||||
Double temperature,
|
||||
Double topP,
|
||||
Integer topK,
|
||||
Integer timeoutSeconds,
|
||||
Integer maxRetries
|
||||
) implements AiChatModelConfig<AnthropicChatModel.Config> {}
|
||||
|
||||
@ -31,6 +31,7 @@ public record GoogleAiGeminiChatModel(
|
||||
String modelId,
|
||||
Double temperature,
|
||||
Double topP,
|
||||
Integer topK,
|
||||
Integer timeoutSeconds,
|
||||
Integer maxRetries
|
||||
) implements AiChatModelConfig<GoogleAiGeminiChatModel.Config> {}
|
||||
|
||||
@ -31,6 +31,7 @@ public record GoogleVertexAiGeminiChatModel(
|
||||
String modelId,
|
||||
Double temperature,
|
||||
Double topP,
|
||||
Integer topK,
|
||||
Integer timeoutSeconds,
|
||||
Integer maxRetries
|
||||
) implements AiChatModelConfig<GoogleVertexAiGeminiChatModel.Config> {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user