MCPcopy Index your code
hub / github.com/coder/coder / deleteUserChatCompactionThreshold

Method deleteUserChatCompactionThreshold

coderd/exp_chats.go:5986–6009  ·  view source on GitHub ↗

@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)

Source from the content-addressed store, hash-verified

5984// @x-apidocgen {"skip": true}
5985// EXPERIMENTAL: this endpoint is experimental and is subject to change.
5986func (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//

Callers 1

Calls 8

APIKeyFunction · 0.92
CompactionThresholdKeyFunction · 0.92
WriteFunction · 0.92
parseChatModelConfigIDFunction · 0.85
ContextMethod · 0.65
ErrorMethod · 0.45
WriteHeaderMethod · 0.45

Tested by

no test coverage detected