diff --git a/apps/llm/function.py b/apps/llm/function.py index 6165dc455aae038aeb1ad9bcd0840b418c3dc8e8..2f231b1f339e6e770a1a9dc54727c4457185ae99 100644 --- a/apps/llm/function.py +++ b/apps/llm/function.py @@ -280,12 +280,10 @@ class JsonGenerator: """生成JSON""" Draft7Validator.check_schema(self._schema) validator = Draft7Validator(self._schema) - logger.info("[JSONGenerator] Schema:%s", self._schema) while self._count < JSON_GEN_MAX_TRIAL: self._count += 1 result = await self._single_trial() - logger.info("[JSONGenerator] 得到:%s", result) try: validator.validate(result) except Exception as err: # noqa: BLE001 diff --git a/apps/llm/prompt.py b/apps/llm/prompt.py index 7702f6d0912947612b64145402398f222e01a148..40fc015881b908cdf24c4fc8d2ac9c84b0efec73 100644 --- a/apps/llm/prompt.py +++ b/apps/llm/prompt.py @@ -48,7 +48,6 @@ JSON_GEN_BASIC = dedent(r""" {% endif %} - {% if not function_call %} # Tools You must call one function to assist with the user query. @@ -67,5 +66,4 @@ JSON_GEN_BASIC = dedent(r""" # Output - {% endif %} """) diff --git a/apps/routers/mcp_service.py b/apps/routers/mcp_service.py index f08357d8671a412d6d52d039f49e979b378363a4..b238a5cda115e880d75ea91f6aa90a34a0360815 100644 --- a/apps/routers/mcp_service.py +++ b/apps/routers/mcp_service.py @@ -200,11 +200,8 @@ async def get_service_detail( name=data.name, description=data.description, overview=config.overview, - data=json.dumps( - config.config.model_dump(by_alias=True, exclude_none=True), - indent=4, - ensure_ascii=False, - ), + data=config.config.model_dump( + exclude_none=True, by_alias=True), mcpType=config.type, ) else: diff --git a/apps/scheduler/mcp_agent/base.py b/apps/scheduler/mcp_agent/base.py index f69d71ab16d29e23dd047d9f8e7847ec9043ca86..9e91360c1b2fc3759b35d18f26c8ac3d1b29f12d 100644 --- a/apps/scheduler/mcp_agent/base.py +++ b/apps/scheduler/mcp_agent/base.py @@ -24,7 +24,7 @@ class MCPBase: message, streaming=False, temperature=0.07, - result_only=True, + result_only=False, ): result += chunk diff --git a/apps/schemas/response_data.py b/apps/schemas/response_data.py index 14e1e867595ec07a18b7c0e8eadeedbc10d630f7..b8299fe8357520757a19d7ede4d5a48ab330d124 100644 --- a/apps/schemas/response_data.py +++ b/apps/schemas/response_data.py @@ -530,7 +530,7 @@ class EditMCPServiceMsg(BaseModel): name: str = Field(..., description="MCP服务名称") description: str = Field(description="MCP服务描述") overview: str = Field(description="MCP服务概述") - data: str = Field(description="MCP服务配置") + data: dict[str, Any] = Field(description="MCP服务配置") mcp_type: MCPType = Field(alias="mcpType", description="MCP 类型")