mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
add debuging to Tool calls
This commit is contained in:
@@ -30,6 +30,9 @@ class CrewaiPlatformToolBuilder:
|
|||||||
def _fetch_actions(self):
|
def _fetch_actions(self):
|
||||||
actions_url = f"{get_platform_api_base_url()}/actions"
|
actions_url = f"{get_platform_api_base_url()}/actions"
|
||||||
headers = {"Authorization": f"Bearer {get_platform_integration_token()}"}
|
headers = {"Authorization": f"Bearer {get_platform_integration_token()}"}
|
||||||
|
print("->>>>> headers:", headers)
|
||||||
|
print("->>>>> actions_url:", actions_url)
|
||||||
|
print("->>>>> apps:", ",".join(self._apps))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
@@ -39,11 +42,14 @@ class CrewaiPlatformToolBuilder:
|
|||||||
params={"apps": ",".join(self._apps)},
|
params={"apps": ",".join(self._apps)},
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
print("->>>>> error in _fetch_actions")
|
||||||
|
print("->>>>> error:", e)
|
||||||
return
|
return
|
||||||
|
|
||||||
raw_data = response.json()
|
|
||||||
|
|
||||||
|
raw_data = response.json()
|
||||||
|
print("->>>>> raw_data:", raw_data)
|
||||||
self._actions_schema = {}
|
self._actions_schema = {}
|
||||||
action_categories = raw_data.get("actions", {})
|
action_categories = raw_data.get("actions", {})
|
||||||
|
|
||||||
|
|||||||
@@ -640,12 +640,14 @@ class Agent(BaseAgent):
|
|||||||
|
|
||||||
def get_platform_tools(self, apps: list[PlatformAppOrAction]) -> list[BaseTool]:
|
def get_platform_tools(self, apps: list[PlatformAppOrAction]) -> list[BaseTool]:
|
||||||
try:
|
try:
|
||||||
|
print("->>>>> start get_platform_tools:", apps)
|
||||||
from crewai_tools import (
|
from crewai_tools import (
|
||||||
CrewaiPlatformTools,
|
CrewaiPlatformTools,
|
||||||
)
|
)
|
||||||
|
|
||||||
return CrewaiPlatformTools(apps=apps)
|
return CrewaiPlatformTools(apps=apps)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print("->>>>> error in get_platform_tools")
|
||||||
self._logger.log("error", f"Error getting platform tools: {e!s}")
|
self._logger.log("error", f"Error getting platform tools: {e!s}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user