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

Method DeleteWorkingMemory

server/handlers/memory.go:308–338  ·  view source on GitHub ↗

DeleteWorkingMemory deletes working memory

(c *gin.Context)

Source from the content-addressed store, hash-verified

306
307// DeleteWorkingMemory deletes working memory
308func (h *MemoryHandler) DeleteWorkingMemory(c *gin.Context) {
309 ctx := c.Request.Context()
310 id := c.Param("id")
311
312 if err := (*h.store).Delete(ctx, "working_memory", id); err != nil {
313 if errors.Is(err, store.ErrNotFound) {
314 c.JSON(http.StatusNotFound, gin.H{
315 "success": false,
316 "error": gin.H{
317 "code": "not_found",
318 "message": "Working memory not found",
319 },
320 })
321 return
322 }
323 c.JSON(http.StatusInternalServerError, gin.H{
324 "success": false,
325 "error": gin.H{
326 "code": "internal_error",
327 "message": "Failed to delete working memory: " + err.Error(),
328 },
329 })
330 return
331 }
332
333 logging.Info(ctx, "working_memory.deleted", map[string]any{
334 "id": id,
335 })
336
337 c.Status(http.StatusNoContent)
338}
339
340// ClearWorkingMemory clears working memory
341func (h *MemoryHandler) ClearWorkingMemory(c *gin.Context) {

Callers

nothing calls this directly

Calls 6

InfoFunction · 0.92
JSONMethod · 0.80
ContextMethod · 0.65
DeleteMethod · 0.65
ErrorMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected