add debuging to Tool calls

This commit is contained in:
Lucas Gomide
2025-11-06 17:47:32 -03:00
parent 9e5906c52f
commit 2997e6c3ad
2 changed files with 10 additions and 2 deletions

View File

@@ -30,6 +30,9 @@ class CrewaiPlatformToolBuilder:
def _fetch_actions(self):
actions_url = f"{get_platform_api_base_url()}/actions"
headers = {"Authorization": f"Bearer {get_platform_integration_token()}"}
print("->>>>> headers:", headers)
print("->>>>> actions_url:", actions_url)
print("->>>>> apps:", ",".join(self._apps))
try:
response = requests.get(
@@ -39,11 +42,14 @@ class CrewaiPlatformToolBuilder:
params={"apps": ",".join(self._apps)},
)
response.raise_for_status()
except Exception:
except Exception as e:
print("->>>>> error in _fetch_actions")
print("->>>>> error:", e)
return
raw_data = response.json()
raw_data = response.json()
print("->>>>> raw_data:", raw_data)
self._actions_schema = {}
action_categories = raw_data.get("actions", {})

View File

@@ -640,12 +640,14 @@ class Agent(BaseAgent):
def get_platform_tools(self, apps: list[PlatformAppOrAction]) -> list[BaseTool]:
try:
print("->>>>> start get_platform_tools:", apps)
from crewai_tools import (
CrewaiPlatformTools,
)
return CrewaiPlatformTools(apps=apps)
except Exception as e:
print("->>>>> error in get_platform_tools")
self._logger.log("error", f"Error getting platform tools: {e!s}")
return []