fix(chat): remove unnecessary nil check in history loading
Simplify the condition for initializing chat history, assuming loadChatHistory always returns a non-nil slice.
This commit is contained in:
parent
b5e1733952
commit
875e34669c
@ -104,7 +104,7 @@ Be concise and action-oriented. After every tool call, wait for the result.`
|
||||
}
|
||||
|
||||
history := loadChatHistory()
|
||||
if history == nil || len(history) == 0 {
|
||||
if len(history) == 0 {
|
||||
history = []map[string]string{systemPrompt}
|
||||
} else if history[0]["role"] != "system" {
|
||||
history = append([]map[string]string{systemPrompt}, history...)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user