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

Method CreateChatModelConfig

codersdk/chats.go:2255–2267  ·  view source on GitHub ↗

CreateChatModelConfig creates an admin-managed chat model config.

(ctx context.Context, req CreateChatModelConfigRequest)

Source from the content-addressed store, hash-verified

2253
2254// CreateChatModelConfig creates an admin-managed chat model config.
2255func (c *ExperimentalClient) CreateChatModelConfig(ctx context.Context, req CreateChatModelConfigRequest) (ChatModelConfig, error) {
2256 res, err := c.Request(ctx, http.MethodPost, "/api/experimental/chats/model-configs", req)
2257 if err != nil {
2258 return ChatModelConfig{}, err
2259 }
2260 defer res.Body.Close()
2261 if res.StatusCode != http.StatusCreated {
2262 return ChatModelConfig{}, ReadBodyAsError(res)
2263 }
2264
2265 var config ChatModelConfig
2266 return config, json.NewDecoder(res.Body).Decode(&config)
2267}
2268
2269// UpdateChatModelConfig updates an admin-managed chat model config.
2270func (c *ExperimentalClient) UpdateChatModelConfig(ctx context.Context, modelConfigID uuid.UUID, req UpdateChatModelConfigRequest) (ChatModelConfig, error) {

Calls 3

ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
RequestMethod · 0.45