File tree 2 files changed +17
-4
lines changed
2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 767
767
"title" : " Provider"
768
768
},
769
769
"type" : {
770
- "type" : " string" ,
771
- "title" : " Type"
770
+ "$ref" : " #/components/schemas/QuestionType"
772
771
},
773
772
"chat_id" : {
774
773
"type" : " string" ,
897
896
"title" : " QuestionAnswer" ,
898
897
"description" : " Represents a question and answer pair."
899
898
},
899
+ "QuestionType" : {
900
+ "type" : " string" ,
901
+ "enum" : [
902
+ " chat" ,
903
+ " fim"
904
+ ],
905
+ "title" : " QuestionType"
906
+ },
900
907
"ValidationError" : {
901
908
"properties" : {
902
909
"loc" : {
Original file line number Diff line number Diff line change 1
1
import datetime
2
+ from enum import Enum
2
3
from typing import Any , List , Optional , Union
3
4
4
5
import pydantic
@@ -87,6 +88,11 @@ class QuestionAnswer(pydantic.BaseModel):
87
88
answer : Optional [ChatMessage ]
88
89
89
90
91
+ class QuestionType (str , Enum ):
92
+ chat = "chat"
93
+ fim = "fim"
94
+
95
+
90
96
class PartialQuestions (pydantic .BaseModel ):
91
97
"""
92
98
Represents all user messages obtained from a DB row.
@@ -96,7 +102,7 @@ class PartialQuestions(pydantic.BaseModel):
96
102
timestamp : datetime .datetime
97
103
message_id : str
98
104
provider : Optional [str ]
99
- type : str
105
+ type : QuestionType
100
106
101
107
102
108
class PartialQuestionAnswer (pydantic .BaseModel ):
@@ -115,7 +121,7 @@ class Conversation(pydantic.BaseModel):
115
121
116
122
question_answers : List [QuestionAnswer ]
117
123
provider : Optional [str ]
118
- type : str
124
+ type : QuestionType
119
125
chat_id : str
120
126
conversation_timestamp : datetime .datetime
121
127
You can’t perform that action at this time.
0 commit comments