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-tools/tests/tools/exa_search_tool_test.py
lib/crewai-tools/tests/tools/exa_search_tool_test.py
import os from unittest.mock import patch from crewai_tools import EXASearchTool import pytest @pytest.fixture def exa_search_tool(): return EXASearchTool(api_key="test_api_key") @pytest.fixture(autouse=True) def mock_exa_api_key(): with patch.dict(os.environ, {"EXA_API_KEY": "test_key_from_env"}): ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/selenium_scraping_tool_test.py
lib/crewai-tools/tests/tools/selenium_scraping_tool_test.py
import os import tempfile from unittest.mock import MagicMock, patch from bs4 import BeautifulSoup from crewai_tools.tools.selenium_scraping_tool.selenium_scraping_tool import ( SeleniumScrapingTool, ) from selenium.webdriver.chrome.options import Options def mock_driver_with_html(html_content): driver = Mag...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/firecrawl_search_tool_test.py
lib/crewai-tools/tests/tools/firecrawl_search_tool_test.py
import pytest from crewai_tools.tools.firecrawl_search_tool.firecrawl_search_tool import FirecrawlSearchTool @pytest.mark.vcr() def test_firecrawl_search_tool_integration(): tool = FirecrawlSearchTool() result = tool.run(query="firecrawl") assert result is not None assert hasattr(result, 'web') or h...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/serper_dev_tool_test.py
lib/crewai-tools/tests/tools/serper_dev_tool_test.py
import os from unittest.mock import patch from crewai_tools.tools.serper_dev_tool.serper_dev_tool import SerperDevTool import pytest @pytest.fixture(autouse=True) def mock_serper_api_key(): with patch.dict(os.environ, {"SERPER_API_KEY": "test_key"}): yield @pytest.fixture def serper_tool(): return ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/brightdata_serp_tool_test.py
lib/crewai-tools/tests/tools/brightdata_serp_tool_test.py
import unittest from unittest.mock import MagicMock, patch from crewai_tools.tools.brightdata_tool.brightdata_serp import BrightDataSearchTool class TestBrightDataSearchTool(unittest.TestCase): @patch.dict( "os.environ", {"BRIGHT_DATA_API_KEY": "test_api_key", "BRIGHT_DATA_ZONE": "test_zone"}, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/test_mongodb_vector_search_tool.py
lib/crewai-tools/tests/tools/test_mongodb_vector_search_tool.py
import json from unittest.mock import patch from crewai_tools import MongoDBVectorSearchConfig, MongoDBVectorSearchTool import pytest # Unit Test Fixtures @pytest.fixture def mongodb_vector_search_tool(): tool = MongoDBVectorSearchTool( connection_string="foo", database_name="bar", collection_name="test"...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/brightdata_webunlocker_tool_test.py
lib/crewai-tools/tests/tools/brightdata_webunlocker_tool_test.py
from unittest.mock import Mock, patch from crewai_tools.tools.brightdata_tool.brightdata_unlocker import ( BrightDataWebUnlockerTool, ) import requests @patch.dict( "os.environ", {"BRIGHT_DATA_API_KEY": "test_api_key", "BRIGHT_DATA_ZONE": "test_zone"}, ) @patch("crewai_tools.tools.brightdata_tool.brightd...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/brave_search_tool_test.py
lib/crewai-tools/tests/tools/brave_search_tool_test.py
from unittest.mock import patch from crewai_tools.tools.brave_search_tool.brave_search_tool import BraveSearchTool import pytest @pytest.fixture def brave_tool(): return BraveSearchTool(n_results=2) def test_brave_tool_initialization(): tool = BraveSearchTool() assert tool.n_results == 10 assert to...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/files_compressor_tool_test.py
lib/crewai-tools/tests/tools/files_compressor_tool_test.py
from unittest.mock import patch from crewai_tools.tools.files_compressor_tool import FileCompressorTool import pytest @pytest.fixture def tool(): return FileCompressorTool() @patch("os.path.exists", return_value=False) def test_input_path_does_not_exist(mock_exists, tool): result = tool._run("nonexistent_p...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/__init__.py
lib/crewai-tools/tests/tools/__init__.py
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/couchbase_tool_test.py
lib/crewai-tools/tests/tools/couchbase_tool_test.py
from unittest.mock import MagicMock, patch import pytest # Mock the couchbase library before importing the tool # This prevents ImportErrors if couchbase isn't installed in the test environment mock_couchbase = MagicMock() mock_couchbase.search = MagicMock() mock_couchbase.cluster = MagicMock() mock_couchbase.option...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/test_code_interpreter_tool.py
lib/crewai-tools/tests/tools/test_code_interpreter_tool.py
from unittest.mock import patch from crewai_tools.tools.code_interpreter_tool.code_interpreter_tool import ( CodeInterpreterTool, SandboxPython, ) import pytest @pytest.fixture def printer_mock(): with patch("crewai_tools.printer.Printer.print") as mock: yield mock @pytest.fixture def docker_un...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/arxiv_paper_tool_test.py
lib/crewai-tools/tests/tools/arxiv_paper_tool_test.py
from pathlib import Path from unittest.mock import MagicMock, patch import urllib.error import xml.etree.ElementTree as ET from crewai_tools import ArxivPaperTool import pytest @pytest.fixture def tool(): return ArxivPaperTool(download_pdfs=False) def mock_arxiv_response(): return """<?xml version="1.0" en...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/merge_agent_handler_tool_test.py
lib/crewai-tools/tests/tools/merge_agent_handler_tool_test.py
"""Tests for MergeAgentHandlerTool.""" import os from unittest.mock import Mock, patch import pytest from crewai_tools import MergeAgentHandlerTool @pytest.fixture(autouse=True) def mock_agent_handler_api_key(): """Mock the Agent Handler API key environment variable.""" with patch.dict(os.environ, {"AGENT_...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/test_oxylabs_tools.py
lib/crewai-tools/tests/tools/test_oxylabs_tools.py
import json import os from unittest.mock import MagicMock from crewai.tools.base_tool import BaseTool from crewai_tools import ( OxylabsAmazonProductScraperTool, OxylabsAmazonSearchScraperTool, OxylabsGoogleSearchScraperTool, OxylabsUniversalScraperTool, ) from crewai_tools.tools.oxylabs_amazon_product...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/stagehand_tool_test.py
lib/crewai-tools/tests/tools/stagehand_tool_test.py
import sys from unittest.mock import MagicMock, patch import pytest # Create mock classes that will be used by our fixture class MockStagehandModule: def __init__(self): self.Stagehand = MagicMock() self.StagehandConfig = MagicMock() self.StagehandPage = MagicMock() class MockStagehandS...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/crewai_platform_tools/test_crewai_platform_tools.py
lib/crewai-tools/tests/tools/crewai_platform_tools/test_crewai_platform_tools.py
import unittest from unittest.mock import Mock, patch from crewai_tools.tools.crewai_platform_tools import CrewaiPlatformTools class TestCrewaiPlatformTools(unittest.TestCase): @patch.dict("os.environ", {"CREWAI_PLATFORM_INTEGRATION_TOKEN": "test_token"}) @patch( "crewai_tools.tools.crewai_platform_t...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/crewai_platform_tools/test_crewai_platform_tool_builder.py
lib/crewai-tools/tests/tools/crewai_platform_tools/test_crewai_platform_tool_builder.py
import unittest from unittest.mock import Mock, patch from crewai_tools.tools.crewai_platform_tools import ( CrewAIPlatformActionTool, CrewaiPlatformToolBuilder, ) import pytest class TestCrewaiPlatformToolBuilder(unittest.TestCase): @pytest.fixture def platform_tool_builder(self): """Create ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/crewai_platform_tools/test_crewai_platform_action_tool.py
lib/crewai-tools/tests/tools/crewai_platform_tools/test_crewai_platform_action_tool.py
from typing import Union, get_args, get_origin from unittest.mock import patch, Mock import os from crewai_tools.tools.crewai_platform_tools.crewai_platform_action_tool import ( CrewAIPlatformActionTool, ) class TestSchemaProcessing: def setup_method(self): self.base_action_schema = { "f...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/rag/test_rag_tool_add_data_type.py
lib/crewai-tools/tests/tools/rag/test_rag_tool_add_data_type.py
"""Tests for RagTool.add() method with various data_type values.""" from pathlib import Path from tempfile import TemporaryDirectory from unittest.mock import MagicMock, Mock, patch import pytest from crewai_tools.rag.data_types import DataType from crewai_tools.tools.rag.rag_tool import RagTool @pytest.fixture de...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/rag/rag_tool_test.py
lib/crewai-tools/tests/tools/rag/rag_tool_test.py
from pathlib import Path from tempfile import TemporaryDirectory from typing import cast from unittest.mock import MagicMock, Mock, patch from crewai_tools.adapters.crewai_rag_adapter import CrewAIRagAdapter from crewai_tools.tools.rag.rag_tool import RagTool @patch("crewai_tools.adapters.crewai_rag_adapter.get_rag_...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/tools/rag/test_rag_tool_validation.py
lib/crewai-tools/tests/tools/rag/test_rag_tool_validation.py
"""Tests for improved RAG tool validation error messages.""" from unittest.mock import MagicMock, Mock, patch import pytest from pydantic import ValidationError from crewai_tools.tools.rag.rag_tool import RagTool @patch("crewai_tools.adapters.crewai_rag_adapter.create_client") def test_azure_missing_deployment_id_...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_docx_loader.py
lib/crewai-tools/tests/rag/test_docx_loader.py
import tempfile from unittest.mock import Mock, patch from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.docx_loader import DOCXLoader from crewai_tools.rag.source_content import SourceContent import pytest class TestDOCXLoader: @patch("docx.Document") def test_load_docx_from...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_embedding_service.py
lib/crewai-tools/tests/rag/test_embedding_service.py
""" Tests for the enhanced embedding service. """ import os import pytest from unittest.mock import Mock, patch from crewai_tools.rag.embedding_service import EmbeddingService, EmbeddingConfig class TestEmbeddingConfig: """Test the EmbeddingConfig model.""" def test_default_config(self): """Test de...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_mdx_loader.py
lib/crewai-tools/tests/rag/test_mdx_loader.py
import os import tempfile from unittest.mock import Mock, patch from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.mdx_loader import MDXLoader from crewai_tools.rag.source_content import SourceContent import pytest class TestMDXLoader: def _write_temp_mdx(self, content): ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_csv_loader.py
lib/crewai-tools/tests/rag/test_csv_loader.py
import os import tempfile from unittest.mock import Mock, patch from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.csv_loader import CSVLoader from crewai_tools.rag.source_content import SourceContent import pytest @pytest.fixture def temp_csv_file(): created_files = [] def ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_text_loaders.py
lib/crewai-tools/tests/rag/test_text_loaders.py
import hashlib import os import tempfile from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.text_loader import TextFileLoader, TextLoader from crewai_tools.rag.source_content import SourceContent import pytest def write_temp_file(content, suffix=".txt", encoding="utf-8"): with te...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_webpage_loader.py
lib/crewai-tools/tests/rag/test_webpage_loader.py
from unittest.mock import Mock, patch from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.webpage_loader import WebPageLoader from crewai_tools.rag.source_content import SourceContent import pytest class TestWebPageLoader: def setup_mock_response(self, text, status_code=200, conte...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_directory_loader.py
lib/crewai-tools/tests/rag/test_directory_loader.py
import os import tempfile from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.directory_loader import DirectoryLoader from crewai_tools.rag.source_content import SourceContent import pytest @pytest.fixture def temp_directory(): with tempfile.TemporaryDirectory() as temp_dir: ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_xml_loader.py
lib/crewai-tools/tests/rag/test_xml_loader.py
from unittest.mock import Mock, patch from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.webpage_loader import WebPageLoader from crewai_tools.rag.source_content import SourceContent import pytest class TestWebPageLoader: def setup_mock_response(self, text, status_code=200, conte...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/__init__.py
lib/crewai-tools/tests/rag/__init__.py
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/rag/test_json_loader.py
lib/crewai-tools/tests/rag/test_json_loader.py
import json import os import tempfile from unittest.mock import Mock, patch from crewai_tools.rag.base_loader import LoaderResult from crewai_tools.rag.loaders.json_loader import JSONLoader from crewai_tools.rag.source_content import SourceContent import pytest class TestJSONLoader: def _create_temp_json_file(se...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai-tools/tests/adapters/mcp_adapter_test.py
lib/crewai-tools/tests/adapters/mcp_adapter_test.py
from textwrap import dedent from unittest.mock import MagicMock, patch from crewai_tools import MCPServerAdapter from crewai_tools.adapters.tool_collection import ToolCollection from mcp import StdioServerParameters import pytest @pytest.fixture def echo_server_script(): return dedent( ''' from m...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/crew.py
lib/crewai/src/crewai/crew.py
from __future__ import annotations import asyncio from collections.abc import Callable from concurrent.futures import Future from copy import copy as shallow_copy from hashlib import md5 import json import re from typing import ( Any, cast, ) import uuid import warnings from opentelemetry import baggage from ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/lite_agent.py
lib/crewai/src/crewai/lite_agent.py
import asyncio from collections.abc import Callable import inspect import json from typing import ( Any, Literal, cast, get_args, get_origin, ) import uuid from pydantic import ( UUID4, BaseModel, Field, InstanceOf, PrivateAttr, field_validator, model_validator, ) from t...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llm.py
lib/crewai/src/crewai/llm.py
from __future__ import annotations from collections import defaultdict from collections.abc import Callable from datetime import datetime import io import json import logging import os import sys import threading from typing import ( TYPE_CHECKING, Any, Final, Literal, TextIO, TypedDict, ca...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/task.py
lib/crewai/src/crewai/task.py
from __future__ import annotations from concurrent.futures import Future from copy import copy as shallow_copy import datetime from hashlib import md5 import inspect import json import logging from pathlib import Path import threading from typing import ( Any, ClassVar, cast, get_args, get_origin, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/__init__.py
lib/crewai/src/crewai/__init__.py
import threading from typing import Any import urllib.request import warnings from crewai.agent.core import Agent from crewai.crew import Crew from crewai.crews.crew_output import CrewOutput from crewai.flow.flow import Flow from crewai.knowledge.knowledge import Knowledge from crewai.llm import LLM from crewai.llms.b...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/context.py
lib/crewai/src/crewai/context.py
from collections.abc import Generator from contextlib import contextmanager import contextvars import os from typing import Any _platform_integration_token: contextvars.ContextVar[str | None] = ( contextvars.ContextVar("platform_integration_token", default=None) ) def set_platform_integration_token(integration_...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/process.py
lib/crewai/src/crewai/process.py
from enum import Enum class Process(str, Enum): """ Class representing the different processes that can be used to tackle tasks """ sequential = "sequential" hierarchical = "hierarchical" # TODO: consensual = 'consensual'
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/lite_agent_output.py
lib/crewai/src/crewai/lite_agent_output.py
"""Output class for LiteAgent execution results.""" from __future__ import annotations from typing import Any from pydantic import BaseModel, Field from crewai.utilities.types import LLMMessage class LiteAgentOutput(BaseModel): """Class that represents the result of a LiteAgent execution.""" model_config...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/mypy.py
lib/crewai/src/crewai/mypy.py
"""Mypy plugin for CrewAI decorator type checking. This plugin informs mypy about attributes injected by the @CrewBase decorator. """ from collections.abc import Callable from mypy.nodes import MDEF, SymbolTableNode, Var from mypy.plugin import ClassDefContext, Plugin from mypy.types import AnyType, TypeOfAny clas...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tasks/llm_guardrail.py
lib/crewai/src/crewai/tasks/llm_guardrail.py
from typing import Any from pydantic import BaseModel, Field from crewai.agent import Agent from crewai.lite_agent_output import LiteAgentOutput from crewai.llms.base_llm import BaseLLM from crewai.tasks.task_output import TaskOutput class LLMGuardrailResult(BaseModel): valid: bool = Field( description=...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tasks/task_output.py
lib/crewai/src/crewai/tasks/task_output.py
"""Task output representation and formatting.""" import json from typing import Any from pydantic import BaseModel, Field, model_validator from crewai.tasks.output_format import OutputFormat from crewai.utilities.types import LLMMessage class TaskOutput(BaseModel): """Class that represents the result of a task...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tasks/hallucination_guardrail.py
lib/crewai/src/crewai/tasks/hallucination_guardrail.py
"""Hallucination Guardrail Placeholder for CrewAI. This is a no-op version of the HallucinationGuardrail for the open-source repository. Classes: HallucinationGuardrail: Placeholder guardrail that validates task outputs. """ from typing import Any from crewai.llm import LLM from crewai.tasks.task_output import ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tasks/output_format.py
lib/crewai/src/crewai/tasks/output_format.py
"""Task output format definitions for CrewAI.""" from enum import Enum class OutputFormat(str, Enum): """Enum that represents the output format of a task. Attributes: JSON: Output as JSON dictionary format PYDANTIC: Output as Pydantic model instance RAW: Output as raw unprocessed str...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tasks/__init__.py
lib/crewai/src/crewai/tasks/__init__.py
from crewai.tasks.output_format import OutputFormat from crewai.tasks.task_output import TaskOutput __all__ = ["OutputFormat", "TaskOutput"]
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tasks/conditional_task.py
lib/crewai/src/crewai/tasks/conditional_task.py
"""Conditional task execution based on previous task output.""" from collections.abc import Callable from typing import Any from pydantic import Field from crewai.task import Task from crewai.tasks.output_format import OutputFormat from crewai.tasks.task_output import TaskOutput class ConditionalTask(Task): ""...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/tool_calling.py
lib/crewai/src/crewai/tools/tool_calling.py
from typing import Any from pydantic import ( BaseModel, BaseModel as PydanticBaseModel, Field, Field as PydanticField, ) class ToolCalling(BaseModel): tool_name: str = Field(..., description="The name of the tool to be called.") arguments: dict[str, Any] | None = Field( ..., descript...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/mcp_native_tool.py
lib/crewai/src/crewai/tools/mcp_native_tool.py
"""Native MCP tool wrapper for CrewAI agents. This module provides a tool wrapper that reuses existing MCP client sessions for better performance and connection management. """ import asyncio from typing import Any from crewai.tools import BaseTool class MCPNativeTool(BaseTool): """Native MCP tool that reuses ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/tool_usage.py
lib/crewai/src/crewai/tools/tool_usage.py
from __future__ import annotations import ast import datetime from difflib import SequenceMatcher import json from json import JSONDecodeError from textwrap import dedent import time from typing import TYPE_CHECKING, Any, Literal import json5 from json_repair import repair_json # type: ignore[import-untyped] from c...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/base_tool.py
lib/crewai/src/crewai/tools/base_tool.py
from __future__ import annotations from abc import ABC, abstractmethod import asyncio from collections.abc import Awaitable, Callable from inspect import Parameter, signature import json from typing import ( Any, Generic, ParamSpec, TypeVar, overload, ) from pydantic import ( BaseModel, Ba...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/tool_types.py
lib/crewai/src/crewai/tools/tool_types.py
from dataclasses import dataclass @dataclass class ToolResult: """Result of tool execution.""" result: str result_as_answer: bool = False
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/__init__.py
lib/crewai/src/crewai/tools/__init__.py
from crewai.tools.base_tool import BaseTool, EnvVar, tool __all__ = [ "BaseTool", "EnvVar", "tool", ]
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/mcp_tool_wrapper.py
lib/crewai/src/crewai/tools/mcp_tool_wrapper.py
"""MCP Tool Wrapper for on-demand MCP server connections.""" import asyncio from crewai.tools import BaseTool MCP_CONNECTION_TIMEOUT = 15 MCP_TOOL_EXECUTION_TIMEOUT = 60 MCP_DISCOVERY_TIMEOUT = 15 MCP_MAX_RETRIES = 3 class MCPToolWrapper(BaseTool): """Lightweight wrapper for MCP tools that connects on-demand....
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/structured_tool.py
lib/crewai/src/crewai/tools/structured_tool.py
from __future__ import annotations import asyncio from collections.abc import Callable import inspect import json import textwrap from typing import TYPE_CHECKING, Any, get_type_hints from pydantic import BaseModel, Field, create_model from crewai.utilities.logger import Logger if TYPE_CHECKING: from crewai.to...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/agent_tools/base_agent_tools.py
lib/crewai/src/crewai/tools/agent_tools/base_agent_tools.py
import logging from typing import Any from pydantic import Field from crewai.agents.agent_builder.base_agent import BaseAgent from crewai.task import Task from crewai.tools.base_tool import BaseTool from crewai.utilities.i18n import I18N, get_i18n logger = logging.getLogger(__name__) class BaseAgentTool(BaseTool)...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/agent_tools/delegate_work_tool.py
lib/crewai/src/crewai/tools/agent_tools/delegate_work_tool.py
from pydantic import BaseModel, Field from crewai.tools.agent_tools.base_agent_tools import BaseAgentTool class DelegateWorkToolSchema(BaseModel): task: str = Field(..., description="The task to delegate") context: str = Field(..., description="The context for the task") coworker: str = Field( .....
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/agent_tools/__init__.py
lib/crewai/src/crewai/tools/agent_tools/__init__.py
"""Agent tools for crewAI."""
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/agent_tools/ask_question_tool.py
lib/crewai/src/crewai/tools/agent_tools/ask_question_tool.py
from pydantic import BaseModel, Field from crewai.tools.agent_tools.base_agent_tools import BaseAgentTool class AskQuestionToolSchema(BaseModel): question: str = Field(..., description="The question to ask") context: str = Field(..., description="The context for the question") coworker: str = Field(..., ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/agent_tools/add_image_tool.py
lib/crewai/src/crewai/tools/agent_tools/add_image_tool.py
from pydantic import BaseModel, Field from crewai.tools.base_tool import BaseTool from crewai.utilities import I18N i18n = I18N() class AddImageToolSchema(BaseModel): image_url: str = Field(..., description="The URL or path of the image to add") action: str | None = Field( default=None, description...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/agent_tools/agent_tools.py
lib/crewai/src/crewai/tools/agent_tools/agent_tools.py
from __future__ import annotations from typing import TYPE_CHECKING from crewai.tools.agent_tools.ask_question_tool import AskQuestionTool from crewai.tools.agent_tools.delegate_work_tool import DelegateWorkTool from crewai.utilities.i18n import get_i18n if TYPE_CHECKING: from crewai.agents.agent_builder.base_a...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/cache_tools/cache_tools.py
lib/crewai/src/crewai/tools/cache_tools/cache_tools.py
from pydantic import BaseModel, Field from crewai.agents.cache.cache_handler import CacheHandler from crewai.tools.structured_tool import CrewStructuredTool class CacheTools(BaseModel): """Default tools to hit the cache.""" name: str = "Hit Cache" cache_handler: CacheHandler = Field( description...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/tools/cache_tools/__init__.py
lib/crewai/src/crewai/tools/cache_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/flow/constants.py
lib/crewai/src/crewai/flow/constants.py
from typing import Final, Literal AND_CONDITION: Final[Literal["AND"]] = "AND" OR_CONDITION: Final[Literal["OR"]] = "OR"
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/flow_wrappers.py
lib/crewai/src/crewai/flow/flow_wrappers.py
"""Wrapper classes for flow decorated methods with type-safe metadata.""" from __future__ import annotations from collections.abc import Callable, Sequence import functools import inspect from typing import Any, Generic, Literal, ParamSpec, TypeAlias, TypeVar, TypedDict from typing_extensions import Required, Self ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/flow.py
lib/crewai/src/crewai/flow/flow.py
"""Core flow execution framework with decorators and state management. This module provides the Flow class and decorators (@start, @listen, @router) for building event-driven workflows with conditional execution and routing. """ from __future__ import annotations import asyncio from collections.abc import Callable, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/utils.py
lib/crewai/src/crewai/flow/utils.py
""" Utility functions for flow visualization and dependency analysis. This module provides core functionality for analyzing and manipulating flow structures, including node level calculation, ancestor tracking, and return value analysis. Functions in this module are primarily used by the visualization system to create...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/config.py
lib/crewai/src/crewai/flow/config.py
from typing import Any, Literal, TypedDict from typing_extensions import NotRequired DarkGray = Literal["#333333"] CrewAIOrange = Literal["#FF5A50"] Gray = Literal["#666666"] White = Literal["#FFFFFF"] Black = Literal["#000000"] DARK_GRAY: Literal["#333333"] = "#333333" CREWAI_ORANGE: Literal["#FF5A50"] = "#FF5A50...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/__init__.py
lib/crewai/src/crewai/flow/__init__.py
from crewai.flow.async_feedback import ( ConsoleProvider, HumanFeedbackPending, HumanFeedbackProvider, PendingFeedbackContext, ) from crewai.flow.flow import Flow, and_, listen, or_, router, start from crewai.flow.human_feedback import HumanFeedbackResult, human_feedback from crewai.flow.persistence imp...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/types.py
lib/crewai/src/crewai/flow/types.py
"""Type definitions for CrewAI Flow module. This module contains TypedDict definitions and type aliases used throughout the Flow system. """ from typing import ( Annotated, Any, NewType, ParamSpec, Protocol, TypeVar, TypedDict, ) from typing_extensions import NotRequired, Required P = P...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/flow_trackable.py
lib/crewai/src/crewai/flow/flow_trackable.py
import inspect from pydantic import BaseModel, Field, InstanceOf, model_validator from typing_extensions import Self from crewai.flow.flow import Flow class FlowTrackable(BaseModel): """Mixin that tracks the Flow instance that instantiated the object, e.g. a Flow instance that created a Crew or Agent. ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/human_feedback.py
lib/crewai/src/crewai/flow/human_feedback.py
"""Human feedback decorator for Flow methods. This module provides the @human_feedback decorator that enables human-in-the-loop workflows within CrewAI Flows. It allows collecting human feedback on method outputs and optionally routing to different listeners based on the feedback. Supports both synchronous (blocking)...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/visualization/schema.py
lib/crewai/src/crewai/flow/visualization/schema.py
"""OpenAPI schema conversion utilities for Flow methods.""" import inspect from typing import Any, get_args, get_origin def type_to_openapi_schema(type_hint: Any) -> dict[str, Any]: """Convert Python type hint to OpenAPI schema. Args: type_hint: Python type hint to convert. Returns: Ope...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/visualization/__init__.py
lib/crewai/src/crewai/flow/visualization/__init__.py
"""Flow structure visualization utilities.""" from crewai.flow.visualization.builder import ( build_flow_structure, calculate_execution_paths, ) from crewai.flow.visualization.renderers import render_interactive from crewai.flow.visualization.types import FlowStructure, NodeMetadata, StructureEdge visualize_...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/visualization/types.py
lib/crewai/src/crewai/flow/visualization/types.py
"""Type definitions for Flow structure visualization.""" from typing import Any, TypedDict class NodeMetadata(TypedDict, total=False): """Metadata for a single node in the flow structure.""" type: str is_router: bool router_paths: list[str] condition_type: str | None trigger_condition_type: ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/visualization/builder.py
lib/crewai/src/crewai/flow/visualization/builder.py
"""Flow structure builder for analyzing Flow execution.""" from __future__ import annotations from collections import defaultdict import inspect import logging from typing import TYPE_CHECKING, Any from crewai.flow.constants import AND_CONDITION, OR_CONDITION from crewai.flow.flow_wrappers import FlowCondition from ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/visualization/renderers/interactive.py
lib/crewai/src/crewai/flow/visualization/renderers/interactive.py
"""Interactive HTML renderer for Flow structure visualization.""" import json from pathlib import Path import tempfile from typing import Any, ClassVar import webbrowser from jinja2 import Environment, FileSystemLoader, nodes, select_autoescape from jinja2.ext import Extension from jinja2.parser import Parser 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/flow/visualization/renderers/__init__.py
lib/crewai/src/crewai/flow/visualization/renderers/__init__.py
"""Flow structure visualization renderers.""" from crewai.flow.visualization.renderers.interactive import render_interactive __all__ = [ "render_interactive", ]
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/persistence/sqlite.py
lib/crewai/src/crewai/flow/persistence/sqlite.py
""" SQLite-based implementation of flow state persistence. """ from __future__ import annotations from datetime import datetime, timezone import json from pathlib import Path import sqlite3 from typing import TYPE_CHECKING, Any from pydantic import BaseModel from crewai.flow.persistence.base import FlowPersistence ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/persistence/decorators.py
lib/crewai/src/crewai/flow/persistence/decorators.py
""" Decorators for flow state persistence. Example: ```python from crewai.flow.flow import Flow, start from crewai.flow.persistence import persist, SQLiteFlowPersistence class MyFlow(Flow): @start() @persist(SQLiteFlowPersistence()) def sync_method(self): # Synchro...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/persistence/__init__.py
lib/crewai/src/crewai/flow/persistence/__init__.py
""" CrewAI Flow Persistence. This module provides interfaces and implementations for persisting flow states. """ from typing import Any, TypeVar from pydantic import BaseModel from crewai.flow.persistence.base import FlowPersistence from crewai.flow.persistence.decorators import persist from crewai.flow.persistence...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/persistence/base.py
lib/crewai/src/crewai/flow/persistence/base.py
"""Base class for flow state persistence.""" from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any from pydantic import BaseModel if TYPE_CHECKING: from crewai.flow.async_feedback.types import PendingFeedbackContext class FlowPersistence(ABC): """Abst...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/async_feedback/providers.py
lib/crewai/src/crewai/flow/async_feedback/providers.py
"""Default provider implementations for human feedback. This module provides the ConsoleProvider, which is the default synchronous provider that collects feedback via console input. """ from __future__ import annotations from typing import TYPE_CHECKING from crewai.flow.async_feedback.types import PendingFeedbackCo...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/async_feedback/__init__.py
lib/crewai/src/crewai/flow/async_feedback/__init__.py
"""Async human feedback support for CrewAI Flows. This module provides abstractions for non-blocking human-in-the-loop workflows, allowing integration with external systems like Slack, Teams, webhooks, or APIs. Example: ```python from crewai.flow import Flow, start, human_feedback from crewai.flow.async_f...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/flow/async_feedback/types.py
lib/crewai/src/crewai/flow/async_feedback/types.py
"""Core types for async human feedback in Flows. This module defines the protocol, exception, and context types used for non-blocking human-in-the-loop workflows. """ from __future__ import annotations from dataclasses import dataclass, field from datetime import datetime from typing import TYPE_CHECKING, Any, Proto...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/constants.py
lib/crewai/src/crewai/agents/constants.py
"""Constants for agent-related modules.""" import re from typing import Final # crewai.agents.parser constants FINAL_ANSWER_ACTION: Final[str] = "Final Answer:" MISSING_ACTION_AFTER_THOUGHT_ERROR_MESSAGE: Final[str] = ( "I did it wrong. Invalid Format: I missed the 'Action:' after 'Thought:'. I will do right ne...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/parser.py
lib/crewai/src/crewai/agents/parser.py
"""Agent output parsing module for ReAct-style LLM responses. This module provides parsing functionality for agent outputs that follow the ReAct (Reasoning and Acting) format, converting them into structured AgentAction or AgentFinish objects. """ from dataclasses import dataclass from json_repair import repair_json...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/tools_handler.py
lib/crewai/src/crewai/agents/tools_handler.py
"""Tools handler for managing tool execution and caching.""" from __future__ import annotations import json from typing import TYPE_CHECKING, Any from pydantic import GetCoreSchemaHandler from pydantic_core import CoreSchema, core_schema from crewai.tools.cache_tools.cache_tools import CacheTools if TYPE_CHECKING...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/__init__.py
lib/crewai/src/crewai/agents/__init__.py
from crewai.agents.cache.cache_handler import CacheHandler from crewai.agents.parser import AgentAction, AgentFinish, OutputParserError, parse from crewai.agents.tools_handler import ToolsHandler __all__ = [ "AgentAction", "AgentFinish", "CacheHandler", "OutputParserError", "ToolsHandler", "pa...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/crew_agent_executor.py
lib/crewai/src/crewai/agents/crew_agent_executor.py
"""Agent executor for crew AI agents. Handles agent execution flow including LLM interactions, tool execution, and memory management. """ from __future__ import annotations from collections.abc import Callable import logging from typing import TYPE_CHECKING, Any, Literal, cast from pydantic import BaseModel, GetCor...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/agent_builder/base_agent.py
lib/crewai/src/crewai/agents/agent_builder/base_agent.py
from __future__ import annotations from abc import ABC, abstractmethod from collections.abc import Callable from copy import copy as shallow_copy from hashlib import md5 from typing import Any, Literal import uuid from pydantic import ( UUID4, BaseModel, Field, PrivateAttr, field_validator, mo...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/agent_builder/base_agent_executor_mixin.py
lib/crewai/src/crewai/agents/agent_builder/base_agent_executor_mixin.py
from __future__ import annotations import time from typing import TYPE_CHECKING from crewai.agents.parser import AgentFinish from crewai.events.event_listener import event_listener from crewai.memory.entity.entity_memory_item import EntityMemoryItem from crewai.memory.long_term.long_term_memory_item import LongTermMe...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/agent_builder/__init__.py
lib/crewai/src/crewai/agents/agent_builder/__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/agents/agent_builder/utilities/base_output_converter.py
lib/crewai/src/crewai/agents/agent_builder/utilities/base_output_converter.py
"""Base output converter for transforming text into structured formats.""" from __future__ import annotations from abc import ABC, abstractmethod from typing import Any from pydantic import BaseModel, Field class OutputConverter(BaseModel, ABC): """Abstract base class for converting text to structured formats....
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/agent_builder/utilities/__init__.py
lib/crewai/src/crewai/agents/agent_builder/utilities/__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/agents/agent_builder/utilities/base_token_process.py
lib/crewai/src/crewai/agents/agent_builder/utilities/base_token_process.py
"""Token usage tracking utilities. This module provides utilities for tracking token consumption and request metrics during agent execution. """ from crewai.types.usage_metrics import UsageMetrics class TokenProcess: """Track token usage during agent processing. Attributes: total_tokens: Total numb...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/cache/__init__.py
lib/crewai/src/crewai/agents/cache/__init__.py
from crewai.agents.cache.cache_handler import CacheHandler __all__ = ["CacheHandler"]
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/cache/cache_handler.py
lib/crewai/src/crewai/agents/cache/cache_handler.py
"""Cache handler for tool usage results.""" from typing import Any from pydantic import BaseModel, PrivateAttr from crewai.utilities.rw_lock import RWLock class CacheHandler(BaseModel): """Handles caching of tool execution results. Provides thread-safe in-memory caching for tool outputs based on tool name...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/agents/agent_adapters/base_agent_adapter.py
lib/crewai/src/crewai/agents/agent_adapters/base_agent_adapter.py
from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any from pydantic import ConfigDict, PrivateAttr from crewai.agents.agent_builder.base_agent import BaseAgent if TYPE_CHECKING: from crewai.tools.base_tool import BaseTool class BaseAgentAdapter(BaseAgent...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false