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

Commit 271fbc8

Browse files
authored
fix: use explicit DeprecationWarning for legacy token detection (#440)
1 parent 1b54442 commit 271fbc8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crewai_tools/adapters/enterprise_adapter.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import json
33
import requests
4-
import logging
4+
import warnings
55
from typing import List, Any, Dict, Literal, Optional, Union, get_origin, Type, cast
66
from pydantic import Field, create_model
77
from crewai.tools import BaseTool
@@ -409,8 +409,10 @@ def _create_tools(self):
409409

410410
def _set_enterprise_action_token(self, enterprise_action_token: Optional[str]):
411411
if enterprise_action_token and not enterprise_action_token.startswith("PK_"):
412-
logging.warning(
413-
"Legacy token detected, please consider using the new Enterprise Action Auth token. Check out our docs for more information https://docs.crewai.com/en/enterprise/features/integrations."
412+
warnings.warn(
413+
"Legacy token detected, please consider using the new Enterprise Action Auth token. Check out our docs for more information https://docs.crewai.com/en/enterprise/features/integrations.",
414+
DeprecationWarning,
415+
stacklevel=2
414416
)
415417

416418
token = enterprise_action_token or os.environ.get("CREWAI_ENTERPRISE_TOOLS_TOKEN")

0 commit comments

Comments
 (0)