diff --git a/libs/chatchat-server/chatchat/server/agent/tools_factory/tools_registry.py b/libs/chatchat-server/chatchat/server/agent/tools_factory/tools_registry.py index cd269c0..4eeda2b 100644 --- a/libs/chatchat-server/chatchat/server/agent/tools_factory/tools_registry.py +++ b/libs/chatchat-server/chatchat/server/agent/tools_factory/tools_registry.py @@ -1,6 +1,7 @@ from __future__ import annotations import json +import logging import re from typing import Any, Callable, Dict, Optional, Tuple, Type, Union @@ -31,6 +32,7 @@ def _new_parse_input( """Convert tool input to pydantic model.""" input_args = self.args_schema if isinstance(tool_input, str): + print(f"tool_input:{tool_input}") if input_args is not None: key_ = next(iter(input_args.__fields__.keys())) input_args.validate({key_: tool_input}) @@ -38,6 +40,7 @@ def _new_parse_input( else: if input_args is not None: result = input_args.parse_obj(tool_input) + logging.info(f"result:{result}") return result.dict() @@ -45,6 +48,7 @@ def _new_to_args_and_kwargs(self, tool_input: Union[str, Dict]) -> Tuple[Tuple, # For backwards compatibility, if run_input is a string, # pass as a positional argument. if isinstance(tool_input, str): + logging.info(f"tool_input:{tool_input}") return (tool_input,), {} else: # for tool defined with `*args` parameters @@ -55,6 +59,7 @@ def _new_to_args_and_kwargs(self, tool_input: Union[str, Dict]) -> Tuple[Tuple, # .search_api if "args" in tool_input: args = tool_input["args"] + logging.info(f"args:{args}") if args is None: tool_input.pop("args") return (), tool_input diff --git a/libs/chatchat-server/chatchat/server/agent/tools_factory/weather_check.py b/libs/chatchat-server/chatchat/server/agent/tools_factory/weather_check.py index 359efeb..08d5973 100644 --- a/libs/chatchat-server/chatchat/server/agent/tools_factory/weather_check.py +++ b/libs/chatchat-server/chatchat/server/agent/tools_factory/weather_check.py @@ -4,7 +4,6 @@ import logging import requests -import warnings from chatchat.server.pydantic_v1 import Field from chatchat.server.utils import get_tool_config @@ -17,7 +16,6 @@ def weather_check( ): """Use this tool to check the weather at a specific city""" - # warnings.filterwarnings("ignore", message="Unverified HTTPS request") print(f"weather_check tool内部调用,city{city}") tool_config = get_tool_config("weather_check") api_key = tool_config.get("api_key") diff --git a/libs/chatchat-server/chatchat/webui.py b/libs/chatchat-server/chatchat/webui.py index 6878fc8..df06834 100644 --- a/libs/chatchat-server/chatchat/webui.py +++ b/libs/chatchat-server/chatchat/webui.py @@ -58,7 +58,6 @@ if __name__ == "__main__": sac.MenuItem("多功能对话", icon="chat"), sac.MenuItem("RAG 对话", icon="database"), sac.MenuItem("知识库管理", icon="hdd-stack"), - sac.MenuItem("LLM对话", icon="chat"), ], key="selected_page", open_index=0,