mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-24 23:53:14 +03:00
0c0545b7ae
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
59 lines
1.4 KiB
Python
59 lines
1.4 KiB
Python
from abc import ABC, abstractmethod
|
|
from uuid import UUID
|
|
|
|
from modules.brain.dto.inputs import BrainUpdatableProperties, CreateBrainProperties
|
|
from modules.brain.entity.brain_entity import BrainEntity, PublicBrain
|
|
|
|
|
|
class BrainsInterface(ABC):
|
|
@abstractmethod
|
|
def create_brain(self, brain: CreateBrainProperties) -> BrainEntity:
|
|
"""
|
|
Create a brain in the brains table
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_public_brains(self) -> list[PublicBrain]:
|
|
"""
|
|
Get all public brains
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_brain_details(self, brain_id: UUID, user_id: UUID) -> BrainEntity | None:
|
|
"""
|
|
Get all public brains
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def update_brain_last_update_time(self, brain_id: UUID) -> None:
|
|
"""
|
|
Update the last update time of the brain
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def delete_brain(self, brain_id: UUID):
|
|
"""
|
|
Delete a brain
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def update_brain_by_id(
|
|
self, brain_id: UUID, brain: BrainUpdatableProperties
|
|
) -> BrainEntity | None:
|
|
"""
|
|
Update a brain by id
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_brain_by_id(self, brain_id: UUID) -> BrainEntity | None:
|
|
"""
|
|
Get a brain by id
|
|
"""
|
|
pass
|