Skip to content

Commit f0b3d2f

Browse files
authored
Merge branch 'main' into fix_codegate_cli_context
2 parents 9ecd58b + e05f49a commit f0b3d2f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

api/openapi.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,7 @@
767767
"title": "Provider"
768768
},
769769
"type": {
770-
"type": "string",
771-
"title": "Type"
770+
"$ref": "#/components/schemas/QuestionType"
772771
},
773772
"chat_id": {
774773
"type": "string",
@@ -897,6 +896,14 @@
897896
"title": "QuestionAnswer",
898897
"description": "Represents a question and answer pair."
899898
},
899+
"QuestionType": {
900+
"type": "string",
901+
"enum": [
902+
"chat",
903+
"fim"
904+
],
905+
"title": "QuestionType"
906+
},
900907
"ValidationError": {
901908
"properties": {
902909
"loc": {

src/codegate/api/v1_models.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
from enum import Enum
23
from typing import Any, List, Optional, Union
34

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

8990

91+
class QuestionType(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: QuestionType
100106

101107

102108
class PartialQuestionAnswer(pydantic.BaseModel):
@@ -115,7 +121,7 @@ class Conversation(pydantic.BaseModel):
115121

116122
question_answers: List[QuestionAnswer]
117123
provider: Optional[str]
118-
type: str
124+
type: QuestionType
119125
chat_id: str
120126
conversation_timestamp: datetime.datetime
121127

0 commit comments

Comments
 (0)