mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-05-19 15:05:39 +08:00
refactor: use constants for default assistant messages
Apply code review feedback from gemini-code-assist: - Define default messages as local constants to improve maintainability - Avoid magic strings in the empty content handling logic
This commit is contained in:
@@ -695,10 +695,13 @@ func buildAssistantMessageFromOpenAI(msg gjson.Result) KiroAssistantResponseMess
|
||||
// This can happen with compaction requests or error recovery scenarios
|
||||
finalContent := contentBuilder.String()
|
||||
if strings.TrimSpace(finalContent) == "" {
|
||||
const defaultAssistantContentWithTools = "I'll help you with that."
|
||||
const defaultAssistantContent = "I understand."
|
||||
|
||||
if len(toolUses) > 0 {
|
||||
finalContent = "I'll help you with that."
|
||||
finalContent = defaultAssistantContentWithTools
|
||||
} else {
|
||||
finalContent = "I understand."
|
||||
finalContent = defaultAssistantContent
|
||||
}
|
||||
log.Debugf("kiro-openai: assistant content was empty, using default: %s", finalContent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user