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

Method getChatPlanModeInstructions

coderd/exp_chats.go:4664–4683  ·  view source on GitHub ↗

EXPERIMENTAL: this endpoint is experimental and is subject to change. nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

4662//
4663//nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.
4664func (api *API) getChatPlanModeInstructions(rw http.ResponseWriter, r *http.Request) {
4665 ctx := r.Context()
4666 if !api.Authorize(r, policy.ActionUpdate, rbac.ResourceDeploymentConfig) {
4667 httpapi.ResourceNotFound(rw)
4668 return
4669 }
4670
4671 instructions, err := api.Database.GetChatPlanModeInstructions(ctx)
4672 if err != nil {
4673 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
4674 Message: "Internal error fetching plan mode instructions.",
4675 Detail: err.Error(),
4676 })
4677 return
4678 }
4679
4680 httpapi.Write(ctx, rw, http.StatusOK, codersdk.ChatPlanModeInstructionsResponse{
4681 PlanModeInstructions: instructions,
4682 })
4683}
4684
4685// EXPERIMENTAL: this endpoint is experimental and is subject to change.
4686func (api *API) putChatPlanModeInstructions(rw http.ResponseWriter, r *http.Request) {

Callers 1

chatPlanModeInstructionsFunction · 0.80

Calls 6

AuthorizeMethod · 0.95
ResourceNotFoundFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected