Skip to content

Commit d8b8c0d

Browse files
committed
fix(llms): correct condition for plan usage in CustomLLMProvider #308
Fix the condition to check for exactly 3 messages when determining whether to use the plan in the second round. Previously, it checked for messages less than or equal to 3, which could lead to incorrect behavior.
1 parent 1ba749a commit d8b8c0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomLLMProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class CustomLLMProvider(val project: Project, var llmConfig: LlmConfig = LlmConf
4646
usePlanForSecondRound: Boolean
4747
): Flow<String> {
4848
/// 如果第二轮使用 plan,且 plan 不为空,则使用 plan, 3 = System + User + Assistant
49-
if (usePlanForSecondRound && messages.size <= 3 && LlmConfig.load(ModelType.Plan).isNotEmpty()) {
49+
if (usePlanForSecondRound && messages.size == 3 && LlmConfig.load(ModelType.Plan).isNotEmpty()) {
5050
backupForReasonConfig = llmConfig
5151
llmConfig = LlmConfig.load(ModelType.Plan).first()
5252
} else {

0 commit comments

Comments
 (0)