repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/reset_memories_command.py | lib/crewai/src/crewai/cli/reset_memories_command.py | import subprocess
import click
from crewai.cli.utils import get_crews
def reset_memories_command(
long,
short,
entity,
knowledge,
agent_knowledge,
kickoff_outputs,
all,
) -> None:
"""
Reset the crew memories.
Args:
long (bool): Whether to reset the long-term memory.
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/version.py | lib/crewai/src/crewai/cli/version.py | import importlib.metadata
def get_crewai_version() -> str:
"""Get the version number of CrewAI running the CLI"""
return importlib.metadata.version("crewai")
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/command.py | lib/crewai/src/crewai/cli/command.py | import requests
from requests.exceptions import JSONDecodeError
from rich.console import Console
from crewai.cli.authentication.token import get_auth_token
from crewai.cli.plus_api import PlusAPI
from crewai.telemetry.telemetry import Telemetry
console = Console()
class BaseCommand:
def __init__(self) -> None:... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/train_crew.py | lib/crewai/src/crewai/cli/train_crew.py | import subprocess
import click
def train_crew(n_iterations: int, filename: str) -> None:
"""
Train the crew by running a command in the UV environment.
Args:
n_iterations (int): The number of iterations to train the crew.
"""
command = ["uv", "run", "train", str(n_iterations), filename]
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/add_crew_to_flow.py | lib/crewai/src/crewai/cli/add_crew_to_flow.py | from pathlib import Path
import click
from crewai.cli.utils import copy_template
from crewai.utilities.printer import Printer
_printer = Printer()
def add_crew_to_flow(crew_name: str) -> None:
"""Add a new crew to the current flow."""
# Check if pyproject.toml exists in the current directory
if not Pa... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/run_crew.py | lib/crewai/src/crewai/cli/run_crew.py | from enum import Enum
import os
import subprocess
import click
from packaging import version
from crewai.cli.utils import build_env_with_tool_repository_credentials, read_toml
from crewai.cli.version import get_crewai_version
class CrewType(Enum):
STANDARD = "standard"
FLOW = "flow"
def run_crew() -> None... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/create_crew.py | lib/crewai/src/crewai/cli/create_crew.py | from pathlib import Path
import shutil
import sys
import click
from crewai.cli.constants import ENV_VARS, MODELS
from crewai.cli.provider import (
get_provider_data,
select_model,
select_provider,
)
from crewai.cli.utils import copy_template, load_env_vars, write_env_file
def create_folder_structure(nam... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/plot_flow.py | lib/crewai/src/crewai/cli/plot_flow.py | import subprocess
import click
def plot_flow() -> None:
"""
Plot the flow by running a command in the UV environment.
"""
command = ["uv", "run", "plot"]
try:
result = subprocess.run(command, capture_output=False, text=True, check=True) # noqa: S603
if result.stderr:
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/utils.py | lib/crewai/src/crewai/cli/utils.py | from functools import reduce
import importlib.util
from inspect import getmro, isclass, isfunction, ismethod
import os
from pathlib import Path
import shutil
import sys
from typing import Any, cast, get_type_hints
import click
from rich.console import Console
import tomli
from crewai.cli.config import Settings
from c... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/plus_api.py | lib/crewai/src/crewai/cli/plus_api.py | from typing import Any
from urllib.parse import urljoin
import os
import requests
from crewai.cli.config import Settings
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
from crewai.cli.version import get_crewai_version
class PlusAPI:
"""
This class exposes methods for working with the CrewAI+ ... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/create_flow.py | lib/crewai/src/crewai/cli/create_flow.py | from pathlib import Path
import click
from crewai.telemetry import Telemetry
def create_flow(name):
"""Create a new flow."""
folder_name = name.replace(" ", "_").replace("-", "_").lower()
class_name = name.replace("_", " ").replace("-", " ").title().replace(" ", "")
click.secho(f"Creating flow {fol... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/config.py | lib/crewai/src/crewai/cli/config.py | import json
from logging import getLogger
from pathlib import Path
import tempfile
from typing import Any
from pydantic import BaseModel, Field
from crewai.cli.constants import (
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_AUDIENCE,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_CLIENT_ID,
CREWAI_ENTERPRISE_DEFAULT_OAUTH2_DOMAIN,... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/__init__.py | lib/crewai/src/crewai/cli/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/kickoff_flow.py | lib/crewai/src/crewai/cli/kickoff_flow.py | import subprocess
import click
def kickoff_flow() -> None:
"""
Kickoff the flow by running a command in the UV environment.
"""
command = ["uv", "run", "kickoff"]
try:
result = subprocess.run(command, capture_output=False, text=True, check=True) # noqa: S603
if result.stderr:
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/crew_chat.py | lib/crewai/src/crewai/cli/crew_chat.py | import json
from pathlib import Path
import platform
import re
import sys
import threading
import time
from typing import Any, Final, Literal
import click
from packaging import version
import tomli
from crewai.cli.utils import read_toml
from crewai.cli.version import get_crewai_version
from crewai.crew import Crew
fr... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/install_crew.py | lib/crewai/src/crewai/cli/install_crew.py | import subprocess
import click
# Be mindful about changing this.
# on some environments we don't use this command but instead uv sync directly
# so if you expect this to support more things you will need to replicate it there
# ask @joaomdmoura if you are unsure
def install_crew(proxy_options: list[str]) -> None:
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/provider.py | lib/crewai/src/crewai/cli/provider.py | from collections import defaultdict
import json
import os
from pathlib import Path
import time
import certifi
import click
import requests
from crewai.cli.constants import JSON_URL, MODELS, PROVIDERS
def select_choice(prompt_message, choices):
"""
Presents a list of choices to the user and prompts them to s... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/tools/main.py | lib/crewai/src/crewai/cli/tools/main.py | import base64
from json import JSONDecodeError
import os
from pathlib import Path
import subprocess
import tempfile
from typing import Any
import click
from rich.console import Console
from crewai.cli import git
from crewai.cli.command import BaseCommand, PlusAPIMixin
from crewai.cli.config import Settings
from crewa... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/tools/__init__.py | lib/crewai/src/crewai/cli/tools/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/organization/main.py | lib/crewai/src/crewai/cli/organization/main.py | from requests import HTTPError
from rich.console import Console
from rich.table import Table
from crewai.cli.command import BaseCommand, PlusAPIMixin
from crewai.cli.config import Settings
console = Console()
class OrganizationCommand(BaseCommand, PlusAPIMixin):
def __init__(self):
BaseCommand.__init__... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/organization/__init__.py | lib/crewai/src/crewai/cli/organization/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/deploy/main.py | lib/crewai/src/crewai/cli/deploy/main.py | from typing import Any
from rich.console import Console
from crewai.cli import git
from crewai.cli.command import BaseCommand, PlusAPIMixin
from crewai.cli.utils import fetch_and_json_env_file, get_project_name
console = Console()
class DeployCommand(BaseCommand, PlusAPIMixin):
"""
A class to handle deplo... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/deploy/__init__.py | lib/crewai/src/crewai/cli/deploy/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/settings/main.py | lib/crewai/src/crewai/cli/settings/main.py | from datetime import datetime
import os
from typing import Any
from rich.console import Console
from rich.table import Table
from crewai.cli.command import BaseCommand
from crewai.cli.config import HIDDEN_SETTINGS_KEYS, READONLY_SETTINGS_KEYS, Settings
from crewai.events.listeners.tracing.utils import _load_user_data... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/settings/__init__.py | lib/crewai/src/crewai/cli/settings/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/constants.py | lib/crewai/src/crewai/cli/authentication/constants.py | ALGORITHMS = ["RS256"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/token.py | lib/crewai/src/crewai/cli/authentication/token.py | from crewai.cli.shared.token_manager import TokenManager
class AuthError(Exception):
pass
def get_auth_token() -> str:
"""Get the authentication token."""
access_token = TokenManager().get_token()
if not access_token:
raise AuthError("No token found, make sure you are logged in")
return ... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/main.py | lib/crewai/src/crewai/cli/authentication/main.py | import time
from typing import TYPE_CHECKING, Any, TypeVar, cast
import webbrowser
from pydantic import BaseModel, Field
import requests
from rich.console import Console
from crewai.cli.authentication.utils import validate_jwt_token
from crewai.cli.config import Settings
from crewai.cli.shared.token_manager import To... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/utils.py | lib/crewai/src/crewai/cli/authentication/utils.py | from typing import Any
import jwt
from jwt import PyJWKClient
def validate_jwt_token(
jwt_token: str, jwks_url: str, issuer: str, audience: str
) -> Any:
"""
Verify the token's signature and claims using PyJWT.
:param jwt_token: The JWT (JWS) string to validate.
:param jwks_url: The URL of the JW... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/__init__.py | lib/crewai/src/crewai/cli/authentication/__init__.py | from crewai.cli.authentication.main import AuthenticationCommand
__all__ = ["AuthenticationCommand"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/providers/auth0.py | lib/crewai/src/crewai/cli/authentication/providers/auth0.py | from crewai.cli.authentication.providers.base_provider import BaseProvider
class Auth0Provider(BaseProvider):
def get_authorize_url(self) -> str:
return f"https://{self._get_domain()}/oauth/device/code"
def get_token_url(self) -> str:
return f"https://{self._get_domain()}/oauth/token"
de... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/providers/workos.py | lib/crewai/src/crewai/cli/authentication/providers/workos.py | from crewai.cli.authentication.providers.base_provider import BaseProvider
class WorkosProvider(BaseProvider):
def get_authorize_url(self) -> str:
return f"https://{self._get_domain()}/oauth2/device_authorization"
def get_token_url(self) -> str:
return f"https://{self._get_domain()}/oauth2/to... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/providers/entra_id.py | lib/crewai/src/crewai/cli/authentication/providers/entra_id.py | from typing import cast
from crewai.cli.authentication.providers.base_provider import BaseProvider
class EntraIdProvider(BaseProvider):
def get_authorize_url(self) -> str:
return f"{self._base_url()}/oauth2/v2.0/devicecode"
def get_token_url(self) -> str:
return f"{self._base_url()}/oauth2/v... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/providers/base_provider.py | lib/crewai/src/crewai/cli/authentication/providers/base_provider.py | from abc import ABC, abstractmethod
from crewai.cli.authentication.main import Oauth2Settings
class BaseProvider(ABC):
def __init__(self, settings: Oauth2Settings):
self.settings = settings
@abstractmethod
def get_authorize_url(self) -> str: ...
@abstractmethod
def get_token_url(self) -... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/providers/okta.py | lib/crewai/src/crewai/cli/authentication/providers/okta.py | from crewai.cli.authentication.providers.base_provider import BaseProvider
class OktaProvider(BaseProvider):
def get_authorize_url(self) -> str:
return f"{self._oauth2_base_url()}/v1/device/authorize"
def get_token_url(self) -> str:
return f"{self._oauth2_base_url()}/v1/token"
def get_jw... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/authentication/providers/__init__.py | lib/crewai/src/crewai/cli/authentication/providers/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/triggers/main.py | lib/crewai/src/crewai/cli/triggers/main.py | import json
import subprocess
from typing import Any
from rich.console import Console
from rich.table import Table
from crewai.cli.command import BaseCommand, PlusAPIMixin
console = Console()
class TriggersCommand(BaseCommand, PlusAPIMixin):
"""
A class to handle trigger-related operations for CrewAI proj... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/triggers/__init__.py | lib/crewai/src/crewai/cli/triggers/__init__.py | """Triggers command module for CrewAI CLI."""
from crewai.cli.triggers.main import TriggersCommand
__all__ = ["TriggersCommand"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/__init__.py | lib/crewai/src/crewai/cli/templates/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/crew/crew.py | lib/crewai/src/crewai/cli/templates/crew/crew.py | from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
from crewai.agents.agent_builder.base_agent import BaseAgent
from typing import List
# If you want to run a snippet of code before or after the crew starts,
# you can use the @before_kickoff and @after_kickoff decorator... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/crew/main.py | lib/crewai/src/crewai/cli/templates/crew/main.py | #!/usr/bin/env python
import sys
import warnings
from datetime import datetime
from {{folder_name}}.crew import {{crew_name}}
warnings.filterwarnings("ignore", category=SyntaxWarning, module="pysbd")
# This main file is intended to be a way for you to run your
# crew locally, so refrain from adding unnecessary logi... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/crew/__init__.py | lib/crewai/src/crewai/cli/templates/crew/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/crew/tools/custom_tool.py | lib/crewai/src/crewai/cli/templates/crew/tools/custom_tool.py | from crewai.tools import BaseTool
from typing import Type
from pydantic import BaseModel, Field
class MyCustomToolInput(BaseModel):
"""Input schema for MyCustomTool."""
argument: str = Field(..., description="Description of the argument.")
class MyCustomTool(BaseTool):
name: str = "Name of my tool"
d... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/crew/tools/__init__.py | lib/crewai/src/crewai/cli/templates/crew/tools/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/flow/main.py | lib/crewai/src/crewai/cli/templates/flow/main.py | #!/usr/bin/env python
from random import randint
from pydantic import BaseModel
from crewai.flow import Flow, listen, start
from {{folder_name}}.crews.poem_crew.poem_crew import PoemCrew
class PoemState(BaseModel):
sentence_count: int = 1
poem: str = ""
class PoemFlow(Flow[PoemState]):
@start()
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/flow/__init__.py | lib/crewai/src/crewai/cli/templates/flow/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/flow/tools/custom_tool.py | lib/crewai/src/crewai/cli/templates/flow/tools/custom_tool.py | from typing import Type
from pydantic import BaseModel, Field
from crewai.tools import BaseTool
class MyCustomToolInput(BaseModel):
"""Input schema for MyCustomTool."""
argument: str = Field(..., description="Description of the argument.")
class MyCustomTool(BaseTool):
name: str = "Name of my tool"
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/flow/tools/__init__.py | lib/crewai/src/crewai/cli/templates/flow/tools/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/__init__.py | lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/__init__.py | """Poem crew template."""
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/poem_crew.py | lib/crewai/src/crewai/cli/templates/flow/crews/poem_crew/poem_crew.py | from typing import List
from crewai import Agent, Crew, Process, Task
from crewai.agents.agent_builder.base_agent import BaseAgent
from crewai.project import CrewBase, agent, crew, task
# If you want to run a snippet of code before or after the crew starts,
# you can use the @before_kickoff and @after_kickoff decorat... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/tool/src/{{folder_name}}/__init__.py | lib/crewai/src/crewai/cli/templates/tool/src/{{folder_name}}/__init__.py | from .tool import {{class_name}}
__all__ = ["{{class_name}}"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/templates/tool/src/{{folder_name}}/tool.py | lib/crewai/src/crewai/cli/templates/tool/src/{{folder_name}}/tool.py | from crewai.tools import BaseTool
class {{class_name}}(BaseTool):
name: str = "Name of my tool"
description: str = "What this tool does. It's vital for effective utilization."
def _run(self, argument: str) -> str:
# Your tool's logic here
return "Tool's result"
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/shared/__init__.py | lib/crewai/src/crewai/cli/shared/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/shared/token_manager.py | lib/crewai/src/crewai/cli/shared/token_manager.py | from datetime import datetime
import json
import os
from pathlib import Path
import sys
import tempfile
from typing import Final, Literal, cast
from cryptography.fernet import Fernet
_FERNET_KEY_LENGTH: Final[Literal[44]] = 44
class TokenManager:
"""Manages encrypted token storage."""
def __init__(self, f... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/enterprise/main.py | lib/crewai/src/crewai/cli/enterprise/main.py | from typing import Any, cast
import requests
from requests.exceptions import JSONDecodeError, RequestException
from rich.console import Console
from crewai.cli.authentication.main import Oauth2Settings, ProviderFactory
from crewai.cli.command import BaseCommand
from crewai.cli.settings.main import SettingsCommand
fro... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/cli/enterprise/__init__.py | lib/crewai/src/crewai/cli/enterprise/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agent/core.py | lib/crewai/src/crewai/agent/core.py | from __future__ import annotations
import asyncio
from collections.abc import Callable, Sequence
import shutil
import subprocess
import time
from typing import (
TYPE_CHECKING,
Any,
Final,
Literal,
cast,
)
from urllib.parse import urlparse
from pydantic import BaseModel, Field, InstanceOf, Private... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | true |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agent/utils.py | lib/crewai/src/crewai/agent/utils.py | """Utility functions for agent task execution.
This module contains shared logic extracted from the Agent's execute_task
and aexecute_task methods to reduce code duplication.
"""
from __future__ import annotations
import json
from typing import TYPE_CHECKING, Any
from crewai.events.event_bus import crewai_event_bus... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agent/__init__.py | lib/crewai/src/crewai/agent/__init__.py | from crewai.agent.core import Agent
from crewai.utilities.training_handler import CrewTrainingHandler
__all__ = ["Agent", "CrewTrainingHandler"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agent/internal/meta.py | lib/crewai/src/crewai/agent/internal/meta.py | """Generic metaclass for agent extensions.
This metaclass enables extension capabilities for agents by detecting
extension fields in class annotations and applying appropriate wrappers.
"""
from typing import Any
import warnings
from pydantic import model_validator
from pydantic._internal._model_construction import ... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agent/internal/__init__.py | lib/crewai/src/crewai/agent/internal/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/telemetry/telemetry.py | lib/crewai/src/crewai/telemetry/telemetry.py | """Telemetry module for CrewAI.
This module provides anonymous telemetry collection for development purposes.
No prompts, task descriptions, agent backstories/goals, responses, or sensitive
data is collected. Users can opt-in to share more complete data using the
`share_crew` attribute.
"""
from __future__ import ann... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | true |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/telemetry/constants.py | lib/crewai/src/crewai/telemetry/constants.py | """Telemetry configuration constants.
This module defines constants used for CrewAI telemetry configuration.
"""
from typing import Final
CREWAI_TELEMETRY_BASE_URL: Final[str] = "https://telemetry.crewai.com:4319"
CREWAI_TELEMETRY_SERVICE_NAME: Final[str] = "crewAI-telemetry"
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/telemetry/utils.py | lib/crewai/src/crewai/telemetry/utils.py | """Telemetry utility functions.
This module provides utility functions for telemetry operations.
"""
from __future__ import annotations
from collections.abc import Callable
from typing import TYPE_CHECKING, Any
from opentelemetry.trace import Span, Status, StatusCode
if TYPE_CHECKING:
from crewai.crew import ... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/telemetry/__init__.py | lib/crewai/src/crewai/telemetry/__init__.py | from crewai.telemetry.telemetry import Telemetry
__all__ = ["Telemetry"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/client.py | lib/crewai/src/crewai/mcp/client.py | """MCP client with session management for CrewAI agents."""
import asyncio
from collections.abc import Callable
from contextlib import AsyncExitStack
from datetime import datetime
import logging
import time
from typing import Any
from typing_extensions import Self
# BaseExceptionGroup is available in Python 3.11+
t... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/filters.py | lib/crewai/src/crewai/mcp/filters.py | """Tool filtering support for MCP servers.
This module provides utilities for filtering tools from MCP servers,
including static allow/block lists and dynamic context-aware filtering.
"""
from collections.abc import Callable
from typing import TYPE_CHECKING, Any
from pydantic import BaseModel, Field
if TYPE_CHECKI... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/config.py | lib/crewai/src/crewai/mcp/config.py | """MCP server configuration models for CrewAI agents.
This module provides Pydantic models for configuring MCP servers with
various transport types, similar to OpenAI's Agents SDK.
"""
from pydantic import BaseModel, Field
from crewai.mcp.filters import ToolFilter
class MCPServerStdio(BaseModel):
"""Stdio MCP ... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/__init__.py | lib/crewai/src/crewai/mcp/__init__.py | """MCP (Model Context Protocol) client support for CrewAI agents.
This module provides native MCP client functionality, allowing CrewAI agents
to connect to any MCP-compliant server using various transport types.
"""
from crewai.mcp.client import MCPClient
from crewai.mcp.config import (
MCPServerConfig,
MCPS... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/transports/http.py | lib/crewai/src/crewai/mcp/transports/http.py | """HTTP and Streamable HTTP transport for MCP servers."""
import asyncio
from typing import Any
from typing_extensions import Self
# BaseExceptionGroup is available in Python 3.11+
try:
from builtins import BaseExceptionGroup
except ImportError:
# Fallback for Python < 3.11 (shouldn't happen in practice)
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/transports/sse.py | lib/crewai/src/crewai/mcp/transports/sse.py | """Server-Sent Events (SSE) transport for MCP servers."""
from typing import Any
from typing_extensions import Self
from crewai.mcp.transports.base import BaseTransport, TransportType
class SSETransport(BaseTransport):
"""SSE transport for connecting to remote MCP servers.
This transport connects to MCP s... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/transports/stdio.py | lib/crewai/src/crewai/mcp/transports/stdio.py | """Stdio transport for MCP servers running as local processes."""
import asyncio
import os
import subprocess
from typing import Any
from typing_extensions import Self
from crewai.mcp.transports.base import BaseTransport, TransportType
class StdioTransport(BaseTransport):
"""Stdio transport for connecting to lo... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/transports/__init__.py | lib/crewai/src/crewai/mcp/transports/__init__.py | """MCP transport implementations for various connection types."""
from crewai.mcp.transports.base import BaseTransport, TransportType
from crewai.mcp.transports.http import HTTPTransport
from crewai.mcp.transports.sse import SSETransport
from crewai.mcp.transports.stdio import StdioTransport
__all__ = [
"BaseTra... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mcp/transports/base.py | lib/crewai/src/crewai/mcp/transports/base.py | """Base transport interface for MCP connections."""
from abc import ABC, abstractmethod
from enum import Enum
from typing import Any, Protocol
from typing_extensions import Self
class TransportType(str, Enum):
"""MCP transport types."""
STDIO = "stdio"
HTTP = "http"
STREAMABLE_HTTP = "streamable-ht... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/crews/utils.py | lib/crewai/src/crewai/crews/utils.py | """Utility functions for crew operations."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine, Iterable
from typing import TYPE_CHECKING, Any
from crewai.agents.agent_builder.base_agent import BaseAgent
from crewai.crews.crew_output import CrewOutput
from crewai.rag.e... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/crews/__init__.py | lib/crewai/src/crewai/crews/__init__.py | from crewai.crews.crew_output import CrewOutput
__all__ = ["CrewOutput"]
| python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/crews/crew_output.py | lib/crewai/src/crewai/crews/crew_output.py | from __future__ import annotations
import json
from typing import Any
from pydantic import BaseModel, Field
from crewai.tasks.output_format import OutputFormat
from crewai.tasks.task_output import TaskOutput
from crewai.types.usage_metrics import UsageMetrics
class CrewOutput(BaseModel):
"""Class that represen... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_flow_resumability_regression.py | lib/crewai/tests/test_flow_resumability_regression.py | """Regression tests for flow listener resumability fix.
These tests ensure that:
1. HITL flows can resume properly without re-executing completed methods
2. Cyclic flows can re-execute methods on each iteration
"""
from typing import Dict
from crewai.flow.flow import Flow, listen, router, start
from crewai.flow.pers... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_llm.py | lib/crewai/tests/test_llm.py | import logging
import os
from time import sleep
from unittest.mock import MagicMock, patch
from crewai.agents.agent_builder.utilities.base_token_process import TokenProcess
from crewai.events.event_types import (
LLMCallCompletedEvent,
LLMStreamChunkEvent,
ToolUsageErrorEvent,
ToolUsageFinishedEvent,
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_crew_thread_safety.py | lib/crewai/tests/test_crew_thread_safety.py | import asyncio
import threading
from concurrent.futures import ThreadPoolExecutor
from typing import Any, Callable, Dict
from unittest.mock import patch
import pytest
from crewai import Agent, Crew, Task
from crewai.utilities.crew.crew_context import get_crew_context
@pytest.fixture
def simple_agent_factory():
d... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_multimodal_validation.py | lib/crewai/tests/test_multimodal_validation.py | import os
import pytest
from crewai import LLM, Agent, Crew, Task
@pytest.mark.skip(reason="Only run manually with valid API keys")
def test_multimodal_agent_with_image_url():
"""
Test that a multimodal agent can process images without validation errors.
This test reproduces the scenario from issue #2475... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_task.py | lib/crewai/tests/test_task.py | """Test Agent creation and execution basic functionality."""
import ast
import json
import os
import time
from functools import partial
from hashlib import md5
from unittest.mock import MagicMock, patch
import pytest
from pydantic import BaseModel
from pydantic_core import ValidationError
from crewai import Agent, C... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | true |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_human_feedback_decorator.py | lib/crewai/tests/test_human_feedback_decorator.py | """Unit tests for the @human_feedback decorator.
This module tests the @human_feedback decorator's validation logic,
async support, and attribute preservation functionality.
"""
from __future__ import annotations
import asyncio
from datetime import datetime
from typing import Any
from unittest.mock import MagicMock,... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_task_guardrails.py | lib/crewai/tests/test_task_guardrails.py | from unittest.mock import Mock, patch
import pytest
from crewai import Agent, Task
from crewai.events.event_bus import crewai_event_bus
from crewai.events.event_types import (
LLMGuardrailCompletedEvent,
LLMGuardrailStartedEvent,
)
from crewai.llm import LLM
from crewai.tasks.hallucination_guardrail import Ha... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_flow.py | lib/crewai/tests/test_flow.py | """Test Flow creation and execution basic functionality."""
import asyncio
import threading
from datetime import datetime
from typing import Optional
import pytest
from pydantic import BaseModel
from crewai.events.event_bus import crewai_event_bus
from crewai.events.types.flow_events import (
FlowFinishedEvent,
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | true |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_streaming.py | lib/crewai/tests/test_streaming.py | """Tests for streaming output functionality in crews and flows."""
import asyncio
from collections.abc import AsyncIterator, Generator
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from crewai import Agent, Crew, Task
from crewai.events.event_bus import crewai_event_bus
from crewai.... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_flow_default_override.py | lib/crewai/tests/test_flow_default_override.py | """Test that persisted state properly overrides default values."""
from crewai.flow.flow import Flow, FlowState, listen, start
from crewai.flow.persistence import persist
class PoemState(FlowState):
"""Test state model with default values that should be overridden."""
sentence_count: int = 1000 # Default th... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_custom_llm.py | lib/crewai/tests/test_custom_llm.py | from typing import Any, Dict, List, Optional, Union
import pytest
from crewai import Agent, Crew, Process, Task
from crewai.llms.base_llm import BaseLLM
from crewai.utilities.llm_utils import create_llm
class CustomLLM(BaseLLM):
"""Custom LLM implementation for testing.
This is a simple implementation of th... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_human_feedback_integration.py | lib/crewai/tests/test_human_feedback_integration.py | """Integration tests for the @human_feedback decorator with Flow.
This module tests the integration of @human_feedback with @listen,
routing behavior, multi-step flows, and state management.
"""
from __future__ import annotations
import asyncio
from datetime import datetime
from typing import Any
from unittest.mock ... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_crew.py | lib/crewai/tests/test_crew.py | """Test Agent creation and execution basic functionality."""
from io import StringIO
import json
import threading
from collections import defaultdict
from concurrent.futures import Future
from hashlib import md5
import re
import sys
from unittest.mock import ANY, MagicMock, call, patch
from crewai.agent import Agent
... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | true |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_hallucination_guardrail.py | lib/crewai/tests/test_hallucination_guardrail.py | from unittest.mock import Mock
import pytest
from crewai.llm import LLM
from crewai.tasks.hallucination_guardrail import HallucinationGuardrail
from crewai.tasks.task_output import TaskOutput
def test_hallucination_guardrail_initialization():
"""Test that the hallucination guardrail initializes correctly with al... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_flow_visualization.py | lib/crewai/tests/test_flow_visualization.py | """Tests for flow visualization and structure building."""
import json
import os
import tempfile
from pathlib import Path
import pytest
from crewai.flow.flow import Flow, and_, listen, or_, router, start
from crewai.flow.visualization import (
build_flow_structure,
visualize_flow_structure,
)
class SimpleF... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_context.py | lib/crewai/tests/test_context.py | # ruff: noqa: S105
import os
from unittest.mock import patch
import pytest
from crewai.context import (
_platform_integration_token,
get_platform_integration_token,
platform_context,
set_platform_integration_token,
)
class TestPlatformIntegrationToken:
def setup_method(self):
_platform_i... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_streaming_integration.py | lib/crewai/tests/test_streaming_integration.py | """Integration tests for streaming with real LLM interactions using cassettes."""
import pytest
from crewai import Agent, Crew, Task
from crewai.flow.flow import Flow, start
from crewai.types.streaming import CrewStreamingOutput, FlowStreamingOutput
@pytest.fixture
def researcher() -> Agent:
"""Create a researc... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_markdown_task.py | lib/crewai/tests/test_markdown_task.py | """Test the markdown attribute in Task class."""
import pytest
from pydantic import BaseModel
from crewai import Agent, Task
@pytest.mark.parametrize(
"markdown_enabled,should_contain_instructions",
[
(True, True),
(False, False),
],
)
def test_markdown_option_in_task_prompt(markdown_ena... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/utils.py | lib/crewai/tests/utils.py | """Test utilities for CrewAI tests."""
import asyncio
from concurrent.futures import ThreadPoolExecutor
def wait_for_event_handlers(timeout: float = 5.0) -> None:
"""Wait for all pending event handlers to complete.
This helper ensures all sync and async handlers finish processing before
proceeding. Usef... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/__init__.py | lib/crewai/tests/__init__.py | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false | |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_flow_human_input_integration.py | lib/crewai/tests/test_flow_human_input_integration.py | from unittest.mock import MagicMock, patch
import pytest
from crewai.events.event_listener import event_listener
class TestFlowHumanInputIntegration:
"""Test integration between Flow execution and human input functionality."""
def test_console_formatter_pause_resume_methods_exist(self):
"""Test that... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_async_human_feedback.py | lib/crewai/tests/test_async_human_feedback.py | """Tests for async human feedback functionality.
This module tests the async/non-blocking human feedback flow, including:
- PendingFeedbackContext creation and serialization
- HumanFeedbackPending exception handling
- HumanFeedbackProvider protocol
- ConsoleProvider
- Flow.from_pending() and Flow.resume()
- SQLite per... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | true |
crewAIInc/crewAI | https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/tests/test_project.py | lib/crewai/tests/test_project.py | from typing import Any, ClassVar
from unittest.mock import Mock, patch
import pytest
from crewai.agent import Agent
from crewai.agents.agent_builder.base_agent import BaseAgent
from crewai.crew import Crew
from crewai.llm import LLM
from crewai.project import (
CrewBase,
after_kickoff,
agent,
before_ki... | python | MIT | f3c17a249b5a2da3a917784d9762421591c1cde5 | 2026-01-04T14:39:52.484392Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.