| 73 | } |
| 74 | |
| 75 | func (r *SQLiteRecorder) RecordInterception(ctx context.Context, req *aibridge.InterceptionRecord) error { |
| 76 | metadata, _ := json.Marshal(req.Metadata) |
| 77 | _, err := r.stmtInsertInterception.ExecContext(ctx, |
| 78 | req.ID, req.InitiatorID, req.Provider, req.Model, req.StartedAt, string(metadata), |
| 79 | ) |
| 80 | if err != nil { |
| 81 | r.logger.Warn(ctx, "failed to record interception", slog.Error(err)) |
| 82 | } |
| 83 | return err |
| 84 | } |
| 85 | |
| 86 | func (r *SQLiteRecorder) RecordInterceptionEnded(ctx context.Context, req *aibridge.InterceptionRecordEnded) error { |
| 87 | _, err := r.stmtUpdateInterception.ExecContext(ctx, req.EndedAt, req.ID) |