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

Method LoadToolCallRecords

pkg/store/json.go:183–198  ·  view source on GitHub ↗

LoadToolCallRecords 加载工具调用记录

(ctx context.Context, agentID string)

Source from the content-addressed store, hash-verified

181
182// LoadToolCallRecords 加载工具调用记录
183func (js *JSONStore) LoadToolCallRecords(ctx context.Context, agentID string) ([]types.ToolCallRecord, error) {
184 js.mu.RLock()
185 defer js.mu.RUnlock()
186
187 var records []types.ToolCallRecord
188 path := filepath.Join(js.agentDir(agentID), "tool_records.json")
189 if err := js.loadJSON(path, &records); err != nil {
190 return nil, err
191 }
192
193 if records == nil {
194 records = []types.ToolCallRecord{}
195 }
196
197 return records, nil
198}
199
200// SaveSnapshot 保存快照
201func (js *JSONStore) SaveSnapshot(ctx context.Context, agentID string, snapshot types.Snapshot) error {

Callers

nothing calls this directly

Calls 3

agentDirMethod · 0.95
loadJSONMethod · 0.95
JoinMethod · 0.45

Tested by

no test coverage detected