fix:issue2323 (#2325)

This commit is contained in:
Aries-ckt
2025-02-07 07:11:42 +08:00
committed by GitHub
parent 1a6ad50b3d
commit bb5a078550
3 changed files with 21 additions and 25 deletions

View File

@@ -231,10 +231,14 @@ class BaseChat(ABC):
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,

View File

@@ -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")

View File

@@ -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.")
@@ -21,19 +18,16 @@ class DatasourceServeRequest(BaseModel):
class DatasourceServeResponse(BaseModel):
"""Flow response model"""
"""Datasource response model"""
model_config = ConfigDict(title=f"ServeResponse for {SERVE_APP_NAME_HUMP}")
"""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.")
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.")