fix: only include history when non-empty
This commit is contained in:
parent
28ba5cfef6
commit
55059fc6c7
1 changed files with 6 additions and 2 deletions
|
|
@ -752,10 +752,14 @@ async initializeAuth(forceRefresh = false) {
|
||||||
conversationState: {
|
conversationState: {
|
||||||
chatTriggerType: KIRO_CONSTANTS.CHAT_TRIGGER_TYPE_MANUAL,
|
chatTriggerType: KIRO_CONSTANTS.CHAT_TRIGGER_TYPE_MANUAL,
|
||||||
conversationId: conversationId,
|
conversationId: conversationId,
|
||||||
currentMessage: {}, // Will be populated as userInputMessage
|
currentMessage: {} // Will be populated as userInputMessage
|
||||||
history: history
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 只有当 history 非空时才添加(API 可能不接受空数组)
|
||||||
|
if (history.length > 0) {
|
||||||
|
request.conversationState.history = history;
|
||||||
|
}
|
||||||
|
|
||||||
// currentMessage 始终是 userInputMessage 类型
|
// currentMessage 始终是 userInputMessage 类型
|
||||||
// 注意:API 不接受 null 值,空字段应该完全不包含
|
// 注意:API 不接受 null 值,空字段应该完全不包含
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue