mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-23 23:22:15 +03:00
1bf67e3640
# Description Prompt module with Service ## 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):
58 lines
1.3 KiB
Python
58 lines
1.3 KiB
Python
from abc import ABC, abstractmethod
|
|
from uuid import UUID
|
|
|
|
from modules.prompt.entity import (
|
|
CreatePromptProperties,
|
|
DeletePromptResponse,
|
|
Prompt,
|
|
PromptUpdatableProperties,
|
|
)
|
|
|
|
|
|
class PromptsInterface(ABC):
|
|
@abstractmethod
|
|
def create_prompt(self, prompt: CreatePromptProperties) -> Prompt:
|
|
"""
|
|
Create a prompt
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def delete_prompt_by_id(self, prompt_id: UUID) -> DeletePromptResponse:
|
|
"""
|
|
Delete a prompt by id
|
|
Args:
|
|
prompt_id (UUID): The id of the prompt
|
|
|
|
Returns:
|
|
A dictionary containing the status of the delete and prompt_id of the deleted prompt
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_prompt_by_id(self, prompt_id: UUID) -> Prompt | None:
|
|
"""
|
|
Get a prompt by its id
|
|
|
|
Args:
|
|
prompt_id (UUID): The id of the prompt
|
|
|
|
Returns:
|
|
Prompt: The prompt
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_public_prompts(self) -> list[Prompt]:
|
|
"""
|
|
List all public prompts
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def update_prompt_by_id(
|
|
self, prompt_id: UUID, prompt: PromptUpdatableProperties
|
|
) -> Prompt:
|
|
"""Update a prompt by id"""
|
|
pass
|