|
3 | 3 | from typing import List, Any, Dict, Optional |
4 | 4 | import json |
5 | 5 | from crewai.tools import BaseTool |
6 | | -from crewai import Agent, Task, Crew |
7 | 6 |
|
8 | 7 |
|
9 | 8 | ENTERPRISE_ACTION_KIT_PROJECT_ID = "dd525517-df22-49d2-a69e-6a0eed211166" |
@@ -202,58 +201,3 @@ def __enter__(self): |
202 | 201 |
|
203 | 202 | def __exit__(self, exc_type, exc_val, exc_tb): |
204 | 203 | 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