mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 17:18:29 +00:00
fix: use explicit DeprecationWarning for legacy token detection (#440)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import os
|
||||
import json
|
||||
import requests
|
||||
import logging
|
||||
import warnings
|
||||
from typing import List, Any, Dict, Literal, Optional, Union, get_origin, Type, cast
|
||||
from pydantic import Field, create_model
|
||||
from crewai.tools import BaseTool
|
||||
@@ -409,8 +409,10 @@ class EnterpriseActionKitToolAdapter:
|
||||
|
||||
def _set_enterprise_action_token(self, enterprise_action_token: Optional[str]):
|
||||
if enterprise_action_token and not enterprise_action_token.startswith("PK_"):
|
||||
logging.warning(
|
||||
"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."
|
||||
warnings.warn(
|
||||
"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.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2
|
||||
)
|
||||
|
||||
token = enterprise_action_token or os.environ.get("CREWAI_ENTERPRISE_TOOLS_TOKEN")
|
||||
|
||||
Reference in New Issue
Block a user