GetUserChatCompactionThresholds fetches the user's per-model chat compaction thresholds.
(ctx context.Context)
| 2761 | // GetUserChatCompactionThresholds fetches the user's per-model chat |
| 2762 | // compaction thresholds. |
| 2763 | func (c *ExperimentalClient) GetUserChatCompactionThresholds(ctx context.Context) (UserChatCompactionThresholds, error) { |
| 2764 | res, err := c.Request(ctx, http.MethodGet, "/api/experimental/chats/config/user-compaction-thresholds", nil) |
| 2765 | if err != nil { |
| 2766 | return UserChatCompactionThresholds{}, err |
| 2767 | } |
| 2768 | defer res.Body.Close() |
| 2769 | if res.StatusCode != http.StatusOK { |
| 2770 | return UserChatCompactionThresholds{}, ReadBodyAsError(res) |
| 2771 | } |
| 2772 | var thresholds UserChatCompactionThresholds |
| 2773 | return thresholds, json.NewDecoder(res.Body).Decode(&thresholds) |
| 2774 | } |
| 2775 | |
| 2776 | // UpdateUserChatCompactionThreshold updates the user's per-model chat |
| 2777 | // compaction threshold. |