Spaces:
Sleeping
Sleeping
Commit ·
c820ac8
1
Parent(s): 31481c9
feat : reomve consolelog
Browse files- services/agents.py +1 -1
- services/linebot.py +3 -3
services/agents.py
CHANGED
|
@@ -329,7 +329,7 @@ def run_agent(user_input: str):
|
|
| 329 |
result = agent.invoke({
|
| 330 |
"messages": [{"role": "user", "content": user_input }]
|
| 331 |
})
|
| 332 |
-
print(f"result:{result}")
|
| 333 |
|
| 334 |
output_format = format_agent_result( result )
|
| 335 |
print(f"output_format:{output_format}")
|
|
|
|
| 329 |
result = agent.invoke({
|
| 330 |
"messages": [{"role": "user", "content": user_input }]
|
| 331 |
})
|
| 332 |
+
#print(f"result:{result}")
|
| 333 |
|
| 334 |
output_format = format_agent_result( result )
|
| 335 |
print(f"output_format:{output_format}")
|
services/linebot.py
CHANGED
|
@@ -143,11 +143,11 @@ def handle_message(event):
|
|
| 143 |
response = run_agent(agent_input)
|
| 144 |
# Agent 的輸出是 JSON 字串 (無論成功或失敗)
|
| 145 |
out_str = response["output"]
|
| 146 |
-
print(f"out_str:{out_str}")
|
| 147 |
tool_result = out_str.get("tool_result", {})
|
| 148 |
-
print(f"tool_result:{tool_result}")
|
| 149 |
final_response = out_str.get("final_response")
|
| 150 |
-
print(f"final_response:{final_response}")
|
| 151 |
|
| 152 |
if "error" in tool_result:
|
| 153 |
# 3A. 處理錯誤情況 (例如:圖片下載失敗、API 錯誤)
|
|
|
|
| 143 |
response = run_agent(agent_input)
|
| 144 |
# Agent 的輸出是 JSON 字串 (無論成功或失敗)
|
| 145 |
out_str = response["output"]
|
| 146 |
+
#print(f"out_str:{out_str}")
|
| 147 |
tool_result = out_str.get("tool_result", {})
|
| 148 |
+
#print(f"tool_result:{tool_result}")
|
| 149 |
final_response = out_str.get("final_response")
|
| 150 |
+
#print(f"final_response:{final_response}")
|
| 151 |
|
| 152 |
if "error" in tool_result:
|
| 153 |
# 3A. 處理錯誤情況 (例如:圖片下載失敗、API 錯誤)
|