@Summary Delete user chat compaction threshold for a model config @x-apidocgen {"skip": true} EXPERIMENTAL: this endpoint is experimental and is subject to change.
(rw http.ResponseWriter, r *http.Request)
| 5984 | // @x-apidocgen {"skip": true} |
| 5985 | // EXPERIMENTAL: this endpoint is experimental and is subject to change. |
| 5986 | func (api *API) deleteUserChatCompactionThreshold(rw http.ResponseWriter, r *http.Request) { |
| 5987 | var ( |
| 5988 | ctx = r.Context() |
| 5989 | apiKey = httpmw.APIKey(r) |
| 5990 | ) |
| 5991 | |
| 5992 | modelConfigID, ok := parseChatModelConfigID(rw, r) |
| 5993 | if !ok { |
| 5994 | return |
| 5995 | } |
| 5996 | |
| 5997 | if err := api.Database.DeleteUserChatCompactionThreshold(ctx, database.DeleteUserChatCompactionThresholdParams{ |
| 5998 | UserID: apiKey.UserID, |
| 5999 | Key: codersdk.CompactionThresholdKey(modelConfigID), |
| 6000 | }); err != nil { |
| 6001 | httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ |
| 6002 | Message: "Error deleting user chat compaction threshold.", |
| 6003 | Detail: err.Error(), |
| 6004 | }) |
| 6005 | return |
| 6006 | } |
| 6007 | |
| 6008 | rw.WriteHeader(http.StatusNoContent) |
| 6009 | } |
| 6010 | |
| 6011 | // EXPERIMENTAL: this endpoint is experimental and is subject to change. |
| 6012 | // |
no test coverage detected