关习习 před 4 dny
rodič
revize
4a97381e5b
3 změnil soubory, kde provedl 12 přidání a 5 odebrání
  1. 4 4
      main.py
  2. 7 0
      mcp_config.json
  3. 1 1
      tools.py

+ 4 - 4
main.py

@@ -122,7 +122,7 @@ def run_conversation(messages):
     if not any(msg.get("role") == "system" for msg in messages):
         messages.insert(0, {"role": "system", "content": system_prompt})
 
-    print("\n🤖 助手: ", end="", flush=True)
+    print("\n助手: ", end="", flush=True)
 
     # 多轮工具调用循环
     while True:
@@ -163,9 +163,9 @@ def run_conversation(messages):
                     "content": tool_result
                 })
 
-                print(f"\n\n🔍 工具结果 ({tool_name}): {tool_result}")
+                print(f"\n\n工具结果 ({tool_name}): {tool_result}")
 
-            print("\n🤖 助手: ", end="", flush=True)
+            print("\n助手: ", end="", flush=True)
         else:
             # 没有工具调用,对话结束
             messages.append({
@@ -185,7 +185,7 @@ def main():
     print("开始多轮对话(输入'exit'结束对话)")
     
     while True:
-        user_input = input("\n👨‍💻 用户: ").strip()
+        user_input = input("\n用户: ").strip()
         
         if user_input.lower() in ['退出', 'quit', 'exit']:
             print("对话结束")

+ 7 - 0
mcp_config.json

@@ -19,6 +19,13 @@
       "args": [
         "bing-cn-mcp"
       ]
+    },
+    "12306-mcp": {
+      "command": "npx",
+      "args": [
+        "-y",
+        "12306-mcp"
+      ]
     }
   }
 }

+ 1 - 1
tools.py

@@ -58,7 +58,7 @@ class Tools:
         return tools
 
     def call_tool(self, tool_name, parameters):
-        print(f"🔧 正在执行工具: {tool_name}({parameters})")
+        print(f"正在执行工具: {tool_name}({parameters})")
 
         # 处理原有的工具
         if tool_name == "luck_num":