Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit a2bf335

Browse files
committed
refactor: remove main execution block from EnterpriseActionKitToolAdapter
- Removed the main execution block that included token validation and agent/task setup for testing. - This change streamlines the adapter's code, focusing on its core functionality without execution logic.
1 parent 3da2f0a commit a2bf335

File tree

1 file changed

+0
-56
lines changed

1 file changed

+0
-56
lines changed

crewai_tools/adapters/enterprise_adapter.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import List, Any, Dict, Optional
44
import json
55
from crewai.tools import BaseTool
6-
from crewai import Agent, Task, Crew
76

87

98
ENTERPRISE_ACTION_KIT_PROJECT_ID = "dd525517-df22-49d2-a69e-6a0eed211166"
@@ -202,58 +201,3 @@ def __enter__(self):
202201

203202
def __exit__(self, exc_type, exc_val, exc_tb):
204203
pass
205-
206-
207-
if __name__ == "__main__":
208-
# IMPORTANT: Replace 'YOUR_TOKEN_HERE' with your actual valid token
209-
# You can also load it from an environment variable for better security
210-
import os
211-
212-
token = os.environ.get(
213-
"ENTERPRISE_TOOL_TOKEN",
214-
) # Replace YOUR_TOKEN_HERE if not using env var
215-
216-
if token == "YOUR_TOKEN_HERE" or not token:
217-
print("Error: ENTERPRISE_TOOL_TOKEN is not set.")
218-
print(
219-
"Please replace 'YOUR_TOKEN_HERE' in the code or set the ENTERPRISE_TOOL_TOKEN environment variable."
220-
)
221-
else:
222-
try:
223-
print("Initializing EnterpriseActionKitTool...")
224-
adapter = EnterpriseActionKitToolAdapter(enterprise_action_token=token)
225-
available_tools = adapter.tools()
226-
227-
agent = Agent(
228-
model="gpt-4o",
229-
tools=available_tools,
230-
role="You are are expert at google sheets",
231-
goal="Get the sheet with the data x",
232-
backstory="You are a expert at google sheets",
233-
verbose=True,
234-
)
235-
236-
task = Task(
237-
description="return data from the sheet with the id: {spreadsheetId}, with the limit: {limit}",
238-
expected_output="The data from the sheet with the id: {spreadsheetId} with the limit: {limit}",
239-
agent=agent,
240-
)
241-
crew = Crew(
242-
agents=[agent],
243-
tasks=[task],
244-
verbose=True,
245-
)
246-
result = crew.kickoff(
247-
inputs={
248-
"spreadsheetId": "1DHDIWGdhUXqXeYOO8yA44poiY222qHPQEUu28olipKs",
249-
"limit": 2,
250-
}
251-
)
252-
253-
except ValueError as e:
254-
print(f"\nConfiguration Error: {e}")
255-
except Exception as e:
256-
print(f"\nAn unexpected error occurred during execution: {e}")
257-
import traceback
258-
259-
traceback.print_exc()

0 commit comments

Comments
 (0)