mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-06 19:40:13 +00:00
feat(core): AWEL flow 2.0 backend code (#1879)
Co-authored-by: yhjun1026 <460342015@qq.com>
This commit is contained in:
43
dbgpt/serve/file/api/schemas.py
Normal file
43
dbgpt/serve/file/api/schemas.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# Define your Pydantic schemas here
|
||||
from typing import Any, Dict
|
||||
|
||||
from dbgpt._private.pydantic import BaseModel, ConfigDict, Field, model_to_dict
|
||||
|
||||
from ..config import SERVE_APP_NAME_HUMP
|
||||
|
||||
|
||||
class ServeRequest(BaseModel):
|
||||
"""File request model"""
|
||||
|
||||
# TODO define your own fields here
|
||||
|
||||
model_config = ConfigDict(title=f"ServeRequest for {SERVE_APP_NAME_HUMP}")
|
||||
|
||||
def to_dict(self, **kwargs) -> Dict[str, Any]:
|
||||
"""Convert the model to a dictionary"""
|
||||
return model_to_dict(self, **kwargs)
|
||||
|
||||
|
||||
class ServerResponse(BaseModel):
|
||||
"""File response model"""
|
||||
|
||||
# TODO define your own fields here
|
||||
|
||||
model_config = ConfigDict(title=f"ServerResponse for {SERVE_APP_NAME_HUMP}")
|
||||
|
||||
def to_dict(self, **kwargs) -> Dict[str, Any]:
|
||||
"""Convert the model to a dictionary"""
|
||||
return model_to_dict(self, **kwargs)
|
||||
|
||||
|
||||
class UploadFileResponse(BaseModel):
|
||||
"""Upload file response model"""
|
||||
|
||||
file_name: str = Field(..., title="The name of the uploaded file")
|
||||
file_id: str = Field(..., title="The ID of the uploaded file")
|
||||
bucket: str = Field(..., title="The bucket of the uploaded file")
|
||||
uri: str = Field(..., title="The URI of the uploaded file")
|
||||
|
||||
def to_dict(self, **kwargs) -> Dict[str, Any]:
|
||||
"""Convert the model to a dictionary"""
|
||||
return model_to_dict(self, **kwargs)
|
Reference in New Issue
Block a user