( ctx context.Context, )
| 4539 | } |
| 4540 | |
| 4541 | func (api *API) defaultCreateChatModelConfigID( |
| 4542 | ctx context.Context, |
| 4543 | ) (uuid.UUID, int, *codersdk.Response) { |
| 4544 | defaultModelConfig, err := api.Database.GetDefaultChatModelConfig(ctx) |
| 4545 | if err != nil { |
| 4546 | if xerrors.Is(err, sql.ErrNoRows) { |
| 4547 | return uuid.Nil, http.StatusBadRequest, &codersdk.Response{ |
| 4548 | Message: "No default chat model config is configured.", |
| 4549 | } |
| 4550 | } |
| 4551 | return uuid.Nil, http.StatusInternalServerError, &codersdk.Response{ |
| 4552 | Message: "Failed to resolve chat model config.", |
| 4553 | Detail: err.Error(), |
| 4554 | } |
| 4555 | } |
| 4556 | |
| 4557 | return defaultModelConfig.ID, 0, nil |
| 4558 | } |
| 4559 | |
| 4560 | func normalizeChatCompressionThreshold( |
| 4561 | requested *int32, |
no test coverage detected