quivr/backend/modules/prompt/entity/prompt.py
Zineb El Bachiri 1bf67e3640
refactor: Prompt module (#1688)
# 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):
2023-11-23 14:13:21 +01:00

41 lines
836 B
Python

from enum import Enum
from typing import Optional
from uuid import UUID
from pydantic import BaseModel
class PromptStatusEnum(str, Enum):
private = "private"
public = "public"
class Prompt(BaseModel):
title: str
content: str
status: PromptStatusEnum = PromptStatusEnum.private
id: UUID
class CreatePromptProperties(BaseModel):
"""Properties that can be received on prompt creation"""
title: str
content: str
status: PromptStatusEnum = PromptStatusEnum.private
class PromptUpdatableProperties(BaseModel):
"""Properties that can be received on prompt update"""
title: Optional[str]
content: Optional[str]
status: Optional[PromptStatusEnum]
class DeletePromptResponse(BaseModel):
"""Response when deleting a prompt"""
status: str = "delete"
prompt_id: UUID