mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-08 20:39:44 +00:00
feat: Client support chatdata (#1343)
This commit is contained in:
41
dbgpt/serve/datasource/api/schemas.py
Normal file
41
dbgpt/serve/datasource/api/schemas.py
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..config import SERVE_APP_NAME_HUMP
|
||||
|
||||
|
||||
class DatasourceServeRequest(BaseModel):
|
||||
"""name: knowledge space name"""
|
||||
|
||||
"""vector_type: vector type"""
|
||||
id: Optional[int] = Field(None, description="The datasource id")
|
||||
db_type: str = Field(..., description="Database type, e.g. sqlite, mysql, etc.")
|
||||
db_name: str = Field(..., description="Database name.")
|
||||
db_path: str = Field("", description="File path for file-based database.")
|
||||
db_host: str = Field("", description="Database host.")
|
||||
db_port: int = Field(0, description="Database port.")
|
||||
db_user: str = Field("", description="Database user.")
|
||||
db_pwd: str = Field("", description="Database password.")
|
||||
comment: str = Field("", description="Comment for the database.")
|
||||
|
||||
|
||||
class DatasourceServeResponse(BaseModel):
|
||||
"""Flow response model"""
|
||||
|
||||
"""name: knowledge space name"""
|
||||
|
||||
"""vector_type: vector type"""
|
||||
id: int = Field(None, description="The datasource id")
|
||||
db_type: str = Field(..., description="Database type, e.g. sqlite, mysql, etc.")
|
||||
db_name: str = Field(..., description="Database name.")
|
||||
db_path: str = Field("", description="File path for file-based database.")
|
||||
db_host: str = Field("", description="Database host.")
|
||||
db_port: int = Field(0, description="Database port.")
|
||||
db_user: str = Field("", description="Database user.")
|
||||
db_pwd: str = Field("", description="Database password.")
|
||||
comment: str = Field("", description="Comment for the database.")
|
||||
|
||||
# TODO define your own fields here
|
||||
class Config:
|
||||
title = f"ServerResponse for {SERVE_APP_NAME_HUMP}"
|
Reference in New Issue
Block a user