mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
chore: remove CREWAI_BASE_URL and fetch url from settings instead
Some checks failed
Some checks failed
This commit is contained in:
@@ -12,6 +12,7 @@ from rich.console import Console
|
|||||||
from crewai.cli import git
|
from crewai.cli import git
|
||||||
from crewai.cli.command import BaseCommand, PlusAPIMixin
|
from crewai.cli.command import BaseCommand, PlusAPIMixin
|
||||||
from crewai.cli.config import Settings
|
from crewai.cli.config import Settings
|
||||||
|
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
|
||||||
from crewai.cli.utils import (
|
from crewai.cli.utils import (
|
||||||
build_env_with_tool_repository_credentials,
|
build_env_with_tool_repository_credentials,
|
||||||
extract_available_exports,
|
extract_available_exports,
|
||||||
@@ -131,10 +132,13 @@ class ToolCommand(BaseCommand, PlusAPIMixin):
|
|||||||
self._validate_response(publish_response)
|
self._validate_response(publish_response)
|
||||||
|
|
||||||
published_handle = publish_response.json()["handle"]
|
published_handle = publish_response.json()["handle"]
|
||||||
|
settings = Settings()
|
||||||
|
base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL
|
||||||
|
|
||||||
console.print(
|
console.print(
|
||||||
f"Successfully published `{published_handle}` ({project_version}).\n\n"
|
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"
|
+ "⚠️ 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",
|
style="bold green",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ from rich.console import Console
|
|||||||
from rich.panel import Panel
|
from rich.panel import Panel
|
||||||
|
|
||||||
from crewai.cli.authentication.token import AuthError, get_auth_token
|
from crewai.cli.authentication.token import AuthError, get_auth_token
|
||||||
|
from crewai.cli.config import Settings
|
||||||
|
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
|
||||||
from crewai.cli.plus_api import PlusAPI
|
from crewai.cli.plus_api import PlusAPI
|
||||||
from crewai.cli.version import get_crewai_version
|
from crewai.cli.version import get_crewai_version
|
||||||
from crewai.events.listeners.tracing.types import TraceEvent
|
from crewai.events.listeners.tracing.types import TraceEvent
|
||||||
@@ -16,7 +18,6 @@ from crewai.events.listeners.tracing.utils import (
|
|||||||
is_tracing_enabled_in_context,
|
is_tracing_enabled_in_context,
|
||||||
should_auto_collect_first_time_traces,
|
should_auto_collect_first_time_traces,
|
||||||
)
|
)
|
||||||
from crewai.utilities.constants import CREWAI_BASE_URL
|
|
||||||
|
|
||||||
|
|
||||||
logger = getLogger(__name__)
|
logger = getLogger(__name__)
|
||||||
@@ -326,10 +327,12 @@ class TraceBatchManager:
|
|||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
access_code = response.json().get("access_code", None)
|
access_code = response.json().get("access_code", None)
|
||||||
console = Console()
|
console = Console()
|
||||||
|
settings = Settings()
|
||||||
|
base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL
|
||||||
return_link = (
|
return_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
|
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:
|
if self.is_current_batch_ephemeral:
|
||||||
|
|||||||
@@ -30,4 +30,3 @@ NOT_SPECIFIED: Final[
|
|||||||
"allows us to distinguish between 'not passed at all' and 'explicitly passed None' or '[]'.",
|
"allows us to distinguish between 'not passed at all' and 'explicitly passed None' or '[]'.",
|
||||||
]
|
]
|
||||||
] = _NotSpecified()
|
] = _NotSpecified()
|
||||||
CREWAI_BASE_URL: Final[str] = "https://app.crewai.com"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user