MCPcopy Create free account
hub / github.com/astercloud/aster / ReadFile

Method ReadFile

pkg/memory/memory.go:90–96  ·  view source on GitHub ↗

ReadFile 读取指定记忆文件内容 name 为相对于 memoryPath 的路径,例如 "project_notes.md" 或 "user/alice.md"

(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

88// ReadFile 读取指定记忆文件内容
89// name 为相对于 memoryPath 的路径,例如 "project_notes.md" 或 "user/alice.md"
90func (m *Manager) ReadFile(ctx context.Context, name string) (string, error) {
91 if name == "" {
92 return "", errors.New("memory.ReadFile: name cannot be empty")
93 }
94 path := m.resolvePath(name)
95 return m.backend.Read(ctx, path, 0, 0)
96}
97
98// AppendNote 以追加模式写入一条记忆
99// file: 目标文件名(相对于 memoryPath)

Callers 15

LoadFunction · 0.45
NewImageFromFileFunction · 0.45
NewVideoFromFileFunction · 0.45
NewAudioFromFileFunction · 0.45
NewFileFromPathFunction · 0.45
ExecuteMethod · 0.45
ReadMethod · 0.45
LoadLocalFunction · 0.45
LoadMethod · 0.45
LoadMethod · 0.45
loadRulesFromFileMethod · 0.45
loadJSONMethod · 0.45

Calls 2

resolvePathMethod · 0.95
ReadMethod · 0.65

Tested by 1

TestCreateFileMethod · 0.36