Skip to content

Commit 605619d

Browse files
committed
make type in PartialQuestions more strict
1 parent ee9a590 commit 605619d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/codegate/api/v1_models.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import datetime
22
from typing import Any, List, Optional, Union
3+
from enum import Enum
34

45
import pydantic
56

@@ -87,6 +88,11 @@ class QuestionAnswer(pydantic.BaseModel):
8788
answer: Optional[ChatMessage]
8889

8990

91+
class PartialQuestionsType(str, Enum):
92+
chat="chat"
93+
fim="fim"
94+
95+
9096
class PartialQuestions(pydantic.BaseModel):
9197
"""
9298
Represents all user messages obtained from a DB row.
@@ -96,7 +102,7 @@ class PartialQuestions(pydantic.BaseModel):
96102
timestamp: datetime.datetime
97103
message_id: str
98104
provider: Optional[str]
99-
type: str
105+
type: PartialQuestionsType
100106

101107

102108
class PartialQuestionAnswer(pydantic.BaseModel):

0 commit comments

Comments
 (0)