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

Method UpdateChatModelConfig

codersdk/chats.go:2270–2282  ·  view source on GitHub ↗

UpdateChatModelConfig updates an admin-managed chat model config.

(ctx context.Context, modelConfigID uuid.UUID, req UpdateChatModelConfigRequest)

Source from the content-addressed store, hash-verified

2268
2269// UpdateChatModelConfig updates an admin-managed chat model config.
2270func (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.
2285func (c *ExperimentalClient) DeleteChatModelConfig(ctx context.Context, modelConfigID uuid.UUID) error {

Callers 2

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45

Tested by 2