added strings to import block, removed unnessary calls
This commit is contained in:
parent
9d5728ec5b
commit
e0b5bbe538
2 changed files with 12 additions and 11 deletions
|
|
@ -146,15 +146,15 @@ func (cb *ContextBuilder) LoadBootstrapFiles() string {
|
|||
"IDENTITY.md",
|
||||
}
|
||||
|
||||
var result string
|
||||
var sb strings.Builder
|
||||
for _, filename := range bootstrapFiles {
|
||||
filePath := filepath.Join(cb.workspace, filename)
|
||||
if data, err := os.ReadFile(filePath); err == nil {
|
||||
result += fmt.Sprintf("## %s\n\n%s\n\n", filename, string(data))
|
||||
fmt.Fprintf(&sb, "## %s\n\n%s\n\n", filename, string(data))
|
||||
}
|
||||
}
|
||||
|
||||
return result
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
func (cb *ContextBuilder) BuildMessages(history []providers.Message, summary string, currentMessage string, media []string, channel, chatID string) []providers.Message {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
|
@ -118,14 +119,14 @@ func (ms *MemoryStore) GetRecentDailyNotes(days int) string {
|
|||
}
|
||||
|
||||
// Join with separator
|
||||
var result string
|
||||
var sb strings.Builder
|
||||
for i, note := range notes {
|
||||
if i > 0 {
|
||||
result += "\n\n---\n\n"
|
||||
sb.WriteString("\n\n---\n\n")
|
||||
}
|
||||
result += note
|
||||
sb.WriteString(note)
|
||||
}
|
||||
return result
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
// GetMemoryContext returns formatted memory context for the agent prompt.
|
||||
|
|
@ -150,12 +151,12 @@ func (ms *MemoryStore) GetMemoryContext() string {
|
|||
}
|
||||
|
||||
// Join parts with separator
|
||||
var result string
|
||||
var sb strings.Builder
|
||||
for i, part := range parts {
|
||||
if i > 0 {
|
||||
result += "\n\n---\n\n"
|
||||
sb.WriteString("\n\n---\n\n")
|
||||
}
|
||||
result += part
|
||||
sb.WriteString(part)
|
||||
}
|
||||
return fmt.Sprintf("# Memory\n\n%s", result)
|
||||
return "# Memory\n\n" + sb.String()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue