File size: 754 Bytes
d26280a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Union

from gpt_engineer.core.files_dict import FilesDict


class BaseVersionManager(ABC):
    """
    Abstract base class for a version manager.

    This class defines the interface for version managers that handle the creation
    of snapshots for code. Implementations of this class are expected to provide
    a method to create a snapshot of the given code.

    Methods
    -------
    snapshot(code: Code) -> str:
        Create a snapshot of the given code and return a reference to it.
    """

    @abstractmethod
    def __init__(self, path: Union[str, Path]):
        pass

    @abstractmethod
    def snapshot(self, files_dict: FilesDict) -> str:
        pass