agent.py aktualisiert

This commit is contained in:
2026-07-05 15:25:35 +00:00
parent 00cfbbedb2
commit 072e303d5f
+11 -3
View File
@@ -54,11 +54,19 @@ class Agent:
} }
}) })
self.logger.info(f"{len(self.tools)} Tools erfolgreich für Bedrock angepasst und geladen") self.logger.info(f"{len(self.tools)}OpenHAB Tools erfolgreich für Bedrock angepasst und geladen")
# Nach dem Laden der MCP-Tools:
from tools.web_search import web_search_tool, web_search
# Manuell hinzufügen
if web_search_tool not in self.tools:
self.tools.append(web_search_tool)
self.logger.info(f"{len(self.tools)} Tools geladen (inkl. Web-Suche)")
except Exception as e: except Exception as e:
self.logger.error(f"Tool Load Error: {e}") self.logger.error(f"Tool Load Error: {e}")
self.tools = [] self.tools = []
# ------------------------- # -------------------------
# TOOL EXECUTION # TOOL EXECUTION
@@ -82,7 +90,7 @@ class Agent:
except Exception as e: except Exception as e:
self.logger.error(f"Tool Error ({name}): {e}") self.logger.error(f"Tool Error ({name}): {e}")
return f"ERROR: {e}" return f"ERROR: {e}"
# ------------------------- # -------------------------
# MAIN LOOP # MAIN LOOP
# ------------------------- # -------------------------