Skip to content

Commit dc63bc2

Browse files
authored
chore: remove CREWAI_BASE_URL and fetch url from settings instead
1 parent 8d0effa commit dc63bc2

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

lib/crewai/src/crewai/cli/tools/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from crewai.cli import git
1313
from crewai.cli.command import BaseCommand, PlusAPIMixin
1414
from crewai.cli.config import Settings
15+
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
1516
from crewai.cli.utils import (
1617
build_env_with_tool_repository_credentials,
1718
extract_available_exports,
@@ -131,10 +132,13 @@ def publish(self, is_public: bool, force: bool = False) -> None:
131132
self._validate_response(publish_response)
132133

133134
published_handle = publish_response.json()["handle"]
135+
settings = Settings()
136+
base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL
137+
134138
console.print(
135139
f"Successfully published `{published_handle}` ({project_version}).\n\n"
136140
+ "⚠️ Security checks are running in the background. Your tool will be available once these are complete.\n"
137-
+ f"You can monitor the status or access your tool here:\nhttps://app.crewai.com/crewai_plus/tools/{published_handle}",
141+
+ f"You can monitor the status or access your tool here:\n{base_url}/crewai_plus/tools/{published_handle}",
138142
style="bold green",
139143
)
140144

lib/crewai/src/crewai/events/listeners/tracing/trace_batch_manager.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
from rich.panel import Panel
1010

1111
from crewai.cli.authentication.token import AuthError, get_auth_token
12+
from crewai.cli.config import Settings
13+
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
1214
from crewai.cli.plus_api import PlusAPI
1315
from crewai.cli.version import get_crewai_version
1416
from crewai.events.listeners.tracing.types import TraceEvent
1517
from crewai.events.listeners.tracing.utils import (
1618
is_tracing_enabled_in_context,
1719
should_auto_collect_first_time_traces,
1820
)
19-
from crewai.utilities.constants import CREWAI_BASE_URL
2021

2122

2223
logger = getLogger(__name__)
@@ -326,10 +327,12 @@ def _finalize_backend_batch(self, events_count: int = 0) -> None:
326327
if response.status_code == 200:
327328
access_code = response.json().get("access_code", None)
328329
console = Console()
330+
settings = Settings()
331+
base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL
329332
return_link = (
330-
f"{CREWAI_BASE_URL}/crewai_plus/trace_batches/{self.trace_batch_id}"
333+
f"{base_url}/crewai_plus/trace_batches/{self.trace_batch_id}"
331334
if not self.is_current_batch_ephemeral and access_code is None
332-
else f"{CREWAI_BASE_URL}/crewai_plus/ephemeral_trace_batches/{self.trace_batch_id}?access_code={access_code}"
335+
else f"{base_url}/crewai_plus/ephemeral_trace_batches/{self.trace_batch_id}?access_code={access_code}"
333336
)
334337

335338
if self.is_current_batch_ephemeral:

lib/crewai/src/crewai/utilities/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ def __repr__(self) -> str:
3030
"allows us to distinguish between 'not passed at all' and 'explicitly passed None' or '[]'.",
3131
]
3232
] = _NotSpecified()
33-
CREWAI_BASE_URL: Final[str] = "https://app.crewai.com"

0 commit comments

Comments
 (0)