UpdateChatModelConfig updates an admin-managed chat model config.
(ctx context.Context, modelConfigID uuid.UUID, req UpdateChatModelConfigRequest)
| 2268 | |
| 2269 | // UpdateChatModelConfig updates an admin-managed chat model config. |
| 2270 | func (c *ExperimentalClient) UpdateChatModelConfig(ctx context.Context, modelConfigID uuid.UUID, req UpdateChatModelConfigRequest) (ChatModelConfig, error) { |
| 2271 | res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/experimental/chats/model-configs/%s", modelConfigID), req) |
| 2272 | if err != nil { |
| 2273 | return ChatModelConfig{}, err |
| 2274 | } |
| 2275 | defer res.Body.Close() |
| 2276 | if res.StatusCode != http.StatusOK { |
| 2277 | return ChatModelConfig{}, ReadBodyAsError(res) |
| 2278 | } |
| 2279 | |
| 2280 | var config ChatModelConfig |
| 2281 | return config, json.NewDecoder(res.Body).Decode(&config) |
| 2282 | } |
| 2283 | |
| 2284 | // DeleteChatModelConfig deletes an admin-managed chat model config. |
| 2285 | func (c *ExperimentalClient) DeleteChatModelConfig(ctx context.Context, modelConfigID uuid.UUID) error { |