update voice history cut
This commit is contained in:
parent
f237aba2a3
commit
c4827bb79b
1 changed files with 7 additions and 1 deletions
|
|
@ -1613,7 +1613,13 @@ func (al *AgentLoop) runTurn(ctx context.Context, ts *turnState) (turnResult, er
|
|||
Role: "system",
|
||||
Content: ts.opts.SystemPromptOverride,
|
||||
})
|
||||
messages = append(messages, history...)
|
||||
|
||||
if ts.opts.IsVoice && len(history) > 2 {
|
||||
messages = append(messages, history[len(history)-2:]...)
|
||||
} else {
|
||||
messages = append(messages, history...)
|
||||
}
|
||||
|
||||
if summary != "" {
|
||||
messages = append(messages, providers.Message{
|
||||
Role: "system",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue