( ctx context.Context, db database.Store, )
| 15 | const titleGenerationOverrideContext = "title_generation" |
| 16 | |
| 17 | func readTitleGenerationModelOverride( |
| 18 | ctx context.Context, |
| 19 | db database.Store, |
| 20 | ) (string, error) { |
| 21 | //nolint:gocritic // Chatd is internal, not a user, so this read uses AsChatd. |
| 22 | chatdCtx := dbauthz.AsChatd(ctx) |
| 23 | raw, err := db.GetChatTitleGenerationModelOverride(chatdCtx) |
| 24 | if err != nil { |
| 25 | return "", xerrors.Errorf( |
| 26 | "get chat title generation model override: %w", |
| 27 | err, |
| 28 | ) |
| 29 | } |
| 30 | return raw, nil |
| 31 | } |
| 32 | |
| 33 | // resolveTitleGenerationModelOverride resolves the deployment-wide title |
| 34 | // generation model override. overrideSet is true when an override was |
no test coverage detected