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

Method GetChatTemplateAllowlist

codersdk/chats.go:2721–2732  ·  view source on GitHub ↗

GetChatTemplateAllowlist returns the deployment-wide chat template allowlist.

(ctx context.Context)

Source from the content-addressed store, hash-verified

2719
2720// GetChatTemplateAllowlist returns the deployment-wide chat template allowlist.
2721func (c *ExperimentalClient) GetChatTemplateAllowlist(ctx context.Context) (ChatTemplateAllowlist, error) {
2722 res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/template-allowlist", nil)
2723 if err != nil {
2724 return ChatTemplateAllowlist{}, err
2725 }
2726 defer res.Body.Close()
2727 if res.StatusCode != http.StatusOK {
2728 return ChatTemplateAllowlist{}, ReadBodyAsError(res)
2729 }
2730 var resp ChatTemplateAllowlist
2731 return resp, json.NewDecoder(res.Body).Decode(&resp)
2732}
2733
2734// UpdateChatTemplateAllowlist updates the deployment-wide chat template allowlist.
2735func (c *ExperimentalClient) UpdateChatTemplateAllowlist(ctx context.Context, req ChatTemplateAllowlist) error {

Callers 1

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 1