MCPcopy Create free account
hub / github.com/compozy/agh / SelectMemoryProvider

Method SelectMemoryProvider

internal/api/core/memory.go:1068–1088  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

1066}
1067
1068func (h *BaseHandlers) SelectMemoryProvider(c *gin.Context) {
1069 if h.MemoryProviders == nil {
1070 h.respondUnsupportedMemoryOperation(c, "selectMemoryProvider")
1071 return
1072 }
1073 var req contract.MemoryProviderSelectRequest
1074 if err := c.ShouldBindJSON(&req); err != nil {
1075 h.respondMemoryError(c, http.StatusBadRequest, err, nil)
1076 return
1077 }
1078 provider, err := h.MemoryProviders.Select(
1079 c.Request.Context(),
1080 strings.TrimSpace(c.Query("workspace_id")),
1081 firstNonEmptyString(req.Name, c.Param("provider_name")),
1082 )
1083 if err != nil {
1084 h.respondMemoryError(c, StatusForMemoryError(err), err, nil)
1085 return
1086 }
1087 c.JSON(http.StatusOK, contract.MemoryProviderResponse{Provider: provider})
1088}
1089
1090func (h *BaseHandlers) EnableMemoryProvider(c *gin.Context) {
1091 if h.MemoryProviders == nil {

Callers

nothing calls this directly

Calls 6

respondMemoryErrorMethod · 0.95
StatusForMemoryErrorFunction · 0.85
firstNonEmptyStringFunction · 0.70
SelectMethod · 0.65
QueryMethod · 0.65

Tested by

no test coverage detected