Skip to content

Commit

Permalink
fix:issue2323 (#2325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aries-ckt authored Feb 6, 2025
1 parent 1a6ad50 commit bb5a078
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 25 deletions.
8 changes: 6 additions & 2 deletions dbgpt/app/scene/base_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,14 @@ async def _build_model_request(self) -> ModelRequest:
span_id=root_tracer.get_current_span_id(),
)
temperature = float(
self._chat_param.get("temperature", self.prompt_template.temperature)
self._chat_param.get("temperature")
if self._chat_param.get("temperature")
else self.prompt_template.temperature
)
max_new_tokens = int(
self._chat_param.get("max_new_tokens", self.prompt_template.max_new_tokens)
self._chat_param.get("max_new_tokens")
if self._chat_param.get("max_new_tokens")
else self.prompt_template.max_new_tokens
)
node = AppChatComposerOperator(
model=self.llm_model,
Expand Down
4 changes: 1 addition & 3 deletions dbgpt/client/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ class AppModel(BaseModel):
app_describe: Optional[str] = Field(None, title="app describe")
team_mode: Optional[str] = Field(None, title="team mode")
language: Optional[str] = Field("en", title="language")
team_context: Optional[Union[str, AWELTeamModel]] = Field(
None, title="team context"
)
team_context: Optional[Union[str, dict]] = Field(None, title="team context")
user_code: Optional[str] = Field(None, title="user code")
sys_code: Optional[str] = Field(None, title="sys code")
is_collected: Optional[str] = Field(None, title="is collected")
Expand Down
34 changes: 14 additions & 20 deletions dbgpt/serve/datasource/api/schemas.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from typing import Optional

from dbgpt._private.pydantic import BaseModel, ConfigDict, Field

from ..config import SERVE_APP_NAME_HUMP
from dbgpt._private.pydantic import BaseModel, Field


class DatasourceServeRequest(BaseModel):
"""name: knowledge space name"""
"""DatasourceServeRequest."""

"""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.")
Expand All @@ -21,19 +18,16 @@ class DatasourceServeRequest(BaseModel):


class DatasourceServeResponse(BaseModel):
"""Flow response model"""

model_config = ConfigDict(title=f"ServeResponse for {SERVE_APP_NAME_HUMP}")

"""name: knowledge space name"""
"""Datasource response model"""

"""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.")
id: Optional[int] = Field(None, description="The datasource id")
db_type: Optional[str] = Field(
None, description="Database type, e.g. sqlite, mysql, etc."
)
db_name: Optional[str] = Field(None, description="Database name.")
db_path: Optional[str] = Field("", description="File path for file-based database.")
db_host: Optional[str] = Field("", description="Database host.")
db_port: Optional[int] = Field(0, description="Database port.")
db_user: Optional[str] = Field("", description="Database user.")
db_pwd: Optional[str] = Field("", description="Database password.")
comment: Optional[str] = Field("", description="Comment for the database.")

0 comments on commit bb5a078

Please sign in to comment.