diff --git a/src/codegate/api/v1_models.py b/src/codegate/api/v1_models.py index 9b23f74e..2eba1d87 100644 --- a/src/codegate/api/v1_models.py +++ b/src/codegate/api/v1_models.py @@ -1,4 +1,5 @@ import datetime +from enum import Enum from typing import Any, List, Optional, Union import pydantic @@ -87,6 +88,11 @@ class QuestionAnswer(pydantic.BaseModel): answer: Optional[ChatMessage] +class QuestionType(str, Enum): + chat = "chat" + fim = "fim" + + class PartialQuestions(pydantic.BaseModel): """ Represents all user messages obtained from a DB row. @@ -96,7 +102,7 @@ class PartialQuestions(pydantic.BaseModel): timestamp: datetime.datetime message_id: str provider: Optional[str] - type: str + type: QuestionType class PartialQuestionAnswer(pydantic.BaseModel): @@ -115,7 +121,7 @@ class Conversation(pydantic.BaseModel): question_answers: List[QuestionAnswer] provider: Optional[str] - type: str + type: QuestionType chat_id: str conversation_timestamp: datetime.datetime