CreateChatModelConfig creates an admin-managed chat model config.
(ctx context.Context, req CreateChatModelConfigRequest)
| 2253 | |
| 2254 | // CreateChatModelConfig creates an admin-managed chat model config. |
| 2255 | func (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. |
| 2270 | func (c *ExperimentalClient) UpdateChatModelConfig(ctx context.Context, modelConfigID uuid.UUID, req UpdateChatModelConfigRequest) (ChatModelConfig, error) { |