SaveToolCallRecords 保存工具调用记录
(ctx context.Context, agentID string, records []types.ToolCallRecord)
| 168 | |
| 169 | // SaveToolCallRecords 保存工具调用记录 |
| 170 | func (js *JSONStore) SaveToolCallRecords(ctx context.Context, agentID string, records []types.ToolCallRecord) error { |
| 171 | js.mu.Lock() |
| 172 | defer js.mu.Unlock() |
| 173 | |
| 174 | if err := js.ensureAgentDir(agentID); err != nil { |
| 175 | return err |
| 176 | } |
| 177 | |
| 178 | path := filepath.Join(js.agentDir(agentID), "tool_records.json") |
| 179 | return js.saveJSON(path, records) |
| 180 | } |
| 181 | |
| 182 | // LoadToolCallRecords 加载工具调用记录 |
| 183 | func (js *JSONStore) LoadToolCallRecords(ctx context.Context, agentID string) ([]types.ToolCallRecord, error) { |
nothing calls this directly
no test coverage detected