MCPcopy Create free account
hub / github.com/EBWi11/AgentSmith-HUB / splitMemoryNotesFromString

Function splitMemoryNotesFromString

src/agent/memory_notes.go:32–49  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

30}
31
32func splitMemoryNotesFromString(s string) MemoryNotes {
33 s = strings.TrimSpace(s)
34 if s == "" {
35 return nil
36 }
37 lines := strings.Split(s, "\n")
38 out := make([]string, 0, len(lines))
39 for _, line := range lines {
40 t := strings.TrimSpace(line)
41 if t != "" {
42 out = append(out, t)
43 }
44 }
45 if len(out) == 0 {
46 return nil
47 }
48 return MemoryNotes(out)
49}
50
51func normalizeMemoryLines(lines []string) MemoryNotes {
52 out := make([]string, 0, len(lines))

Callers 2

UnmarshalYAMLMethod · 0.85

Calls 1

MemoryNotesTypeAlias · 0.85

Tested by

no test coverage detected