mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 15:48:29 +00:00
add debuging to Tool calls
This commit is contained in:
@@ -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", {})
|
||||
|
||||
|
||||
@@ -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 []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user