(ctx context.Context)
| 3351 | } |
| 3352 | |
| 3353 | func (q *querier) GetDefaultChatModelConfig(ctx context.Context) (database.ChatModelConfig, error) { |
| 3354 | // Reading the default model config is needed for chat creation. |
| 3355 | // TODO(CODAGT-161): scope this check when org context is available. |
| 3356 | // This function has no org context to scope the check, and |
| 3357 | // ResourceDeploymentConfig is too restrictive (admin-only). |
| 3358 | // The handler layer gates chat creation via ActionCreate on |
| 3359 | // the org-scoped ResourceChat. |
| 3360 | if _, ok := ActorFromContext(ctx); !ok { |
| 3361 | return database.ChatModelConfig{}, ErrNoActor |
| 3362 | } |
| 3363 | return q.db.GetDefaultChatModelConfig(ctx) |
| 3364 | } |
| 3365 | |
| 3366 | func (q *querier) GetDefaultOrganization(ctx context.Context) (database.Organization, error) { |
| 3367 | return fetch(q.log, q.auth, func(ctx context.Context, _ any) (database.Organization, error) { |
nothing calls this directly
no test coverage detected