GetChatTemplateAllowlist returns the deployment-wide chat template allowlist.
(ctx context.Context)
| 2719 | |
| 2720 | // GetChatTemplateAllowlist returns the deployment-wide chat template allowlist. |
| 2721 | func (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. |
| 2735 | func (c *ExperimentalClient) UpdateChatTemplateAllowlist(ctx context.Context, req ChatTemplateAllowlist) error { |