Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
chore: remove CREWAI_BASE_URL and fetch url from settings instead
Heitor Carvalhodc63bc23198d
diff --git a/lib/crewai/src/crewai/cli/tools/main.py b/lib/crewai/src/crewai/cli/tools/main.pyindex 8fe803980..37467a906 100644--- a/lib/crewai/src/crewai/cli/tools/main.py+++ b/lib/crewai/src/crewai/cli/tools/main.py@@ -12,6 +12,7 @@ from rich.console import Consolefrom crewai.cli import gitfrom crewai.cli.command import BaseCommand, PlusAPIMixinfrom crewai.cli.config import Settings+from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URLfrom crewai.cli.utils import (build_env_with_tool_repository_credentials,extract_available_exports,@@ -131,10 +132,13 @@ class ToolCommand(BaseCommand, PlusAPIMixin):self._validate_response(publish_response)published_handle = publish_response.json()["handle"]+ settings = Settings()+ base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL+console.print(f"Successfully published `{published_handle}` ({project_version}).\n\n"+ "⚠️ Security checks are running in the background. Your tool will be available once these are complete.\n"- + f"You can monitor the status or access your tool here:\nhttps://app.crewai.com/crewai_plus/tools/{published_handle}",+ + f"You can monitor the status or access your tool here:\n{base_url}/crewai_plus/tools/{published_handle}",style="bold green",)diff --git a/lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py b/lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.pyindex 6c2b1c916..3c5bf0aa2 100644--- a/lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py+++ b/lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py@@ -9,6 +9,8 @@ from rich.console import Consolefrom rich.panel import Panelfrom crewai.cli.authentication.token import AuthError, get_auth_token+from crewai.cli.config import Settings+from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URLfrom crewai.cli.plus_api import PlusAPIfrom crewai.cli.version import get_crewai_versionfrom crewai.events.listeners.tracing.types import TraceEvent@@ -16,7 +18,6 @@ from crewai.events.listeners.tracing.utils import (is_tracing_enabled_in_context,should_auto_collect_first_time_traces,)-from crewai.utilities.constants import CREWAI_BASE_URLlogger = getLogger(__name__)@@ -326,10 +327,12 @@ class TraceBatchManager:if response.status_code == 200:access_code = response.json().get("access_code", None)console = Console()+ settings = Settings()+ base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URLreturn_link = (- f"{CREWAI_BASE_URL}/crewai_plus/trace_batches/{self.trace_batch_id}"+ f"{base_url}/crewai_plus/trace_batches/{self.trace_batch_id}"if not self.is_current_batch_ephemeral and access_code is None- else f"{CREWAI_BASE_URL}/crewai_plus/ephemeral_trace_batches/{self.trace_batch_id}?access_code={access_code}"+ else f"{base_url}/crewai_plus/ephemeral_trace_batches/{self.trace_batch_id}?access_code={access_code}")if self.is_current_batch_ephemeral:diff --git a/lib/crewai/src/crewai/utilities/constants.py b/lib/crewai/src/crewai/utilities/constants.pyindex 5823a6111..f1fbcd4d0 100644--- a/lib/crewai/src/crewai/utilities/constants.py+++ b/lib/crewai/src/crewai/utilities/constants.py@@ -30,4 +30,3 @@ NOT_SPECIFIED: Final["allows us to distinguish between 'not passed at all' and 'explicitly passed None' or '[]'.",]] = _NotSpecified()-CREWAI_BASE_URL: Final[str] = "https://app.crewai.com"