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/rag/embeddings/providers/ollama/ollama_provider.py
lib/crewai/src/crewai/rag/embeddings/providers/ollama/ollama_provider.py
"""Ollama embeddings provider.""" from chromadb.utils.embedding_functions.ollama_embedding_function import ( OllamaEmbeddingFunction, ) from pydantic import AliasChoices, Field from crewai.rag.core.base_embeddings_provider import BaseEmbeddingsProvider class OllamaProvider(BaseEmbeddingsProvider[OllamaEmbedding...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/rag/embeddings/providers/ollama/__init__.py
lib/crewai/src/crewai/rag/embeddings/providers/ollama/__init__.py
"""Ollama embedding providers.""" from crewai.rag.embeddings.providers.ollama.ollama_provider import ( OllamaProvider, ) from crewai.rag.embeddings.providers.ollama.types import ( OllamaProviderConfig, OllamaProviderSpec, ) __all__ = [ "OllamaProvider", "OllamaProviderConfig", "OllamaProvider...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/rag/embeddings/providers/ollama/types.py
lib/crewai/src/crewai/rag/embeddings/providers/ollama/types.py
"""Type definitions for Ollama embedding providers.""" from typing import Annotated, Literal from typing_extensions import Required, TypedDict class OllamaProviderConfig(TypedDict, total=False): """Configuration for Ollama provider.""" url: Annotated[str, "http://localhost:11434/api/embeddings"] model_...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/rag/embeddings/providers/google/generative_ai.py
lib/crewai/src/crewai/rag/embeddings/providers/google/generative_ai.py
"""Google Generative AI embeddings provider.""" from typing import Literal from chromadb.utils.embedding_functions.google_embedding_function import ( GoogleGenerativeAiEmbeddingFunction, ) from pydantic import AliasChoices, Field from crewai.rag.core.base_embeddings_provider import BaseEmbeddingsProvider class...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/rag/embeddings/providers/google/__init__.py
lib/crewai/src/crewai/rag/embeddings/providers/google/__init__.py
"""Google embedding providers.""" from crewai.rag.embeddings.providers.google.generative_ai import ( GenerativeAiProvider, ) from crewai.rag.embeddings.providers.google.types import ( GenerativeAiProviderConfig, GenerativeAiProviderSpec, VertexAIProviderConfig, VertexAIProviderSpec, ) from crewai.r...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/rag/embeddings/providers/google/types.py
lib/crewai/src/crewai/rag/embeddings/providers/google/types.py
"""Type definitions for Google embedding providers.""" from typing import Annotated, Literal from typing_extensions import Required, TypedDict class GenerativeAiProviderConfig(TypedDict, total=False): """Configuration for Google Generative AI provider. Attributes: api_key: Google API key for authen...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/rag/embeddings/providers/google/vertex.py
lib/crewai/src/crewai/rag/embeddings/providers/google/vertex.py
"""Google Vertex AI embeddings provider.""" from chromadb.utils.embedding_functions.google_embedding_function import ( GoogleVertexEmbeddingFunction, ) from pydantic import AliasChoices, Field from crewai.rag.core.base_embeddings_provider import BaseEmbeddingsProvider class VertexAIProvider(BaseEmbeddingsProvid...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/knowledge_config.py
lib/crewai/src/crewai/knowledge/knowledge_config.py
from pydantic import BaseModel, Field class KnowledgeConfig(BaseModel): """Configuration for knowledge retrieval. Args: results_limit (int): The number of relevant documents to return. score_threshold (float): The minimum score for a document to be considered relevant. """ results_li...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/knowledge.py
lib/crewai/src/crewai/knowledge/knowledge.py
import os from pydantic import BaseModel, ConfigDict, Field from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage from crewai.rag.embeddings.types import EmbedderConfig from crewai.rag.types import SearchResult os.enviro...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/__init__.py
lib/crewai/src/crewai/knowledge/__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/knowledge/storage/knowledge_storage.py
lib/crewai/src/crewai/knowledge/storage/knowledge_storage.py
import logging import traceback from typing import Any, cast import warnings from crewai.knowledge.storage.base_knowledge_storage import BaseKnowledgeStorage from crewai.rag.chromadb.config import ChromaDBConfig from crewai.rag.chromadb.types import ChromaEmbeddingFunctionWrapper from crewai.rag.config.utils import ge...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/storage/base_knowledge_storage.py
lib/crewai/src/crewai/knowledge/storage/base_knowledge_storage.py
from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any if TYPE_CHECKING: from crewai.rag.types import SearchResult class BaseKnowledgeStorage(ABC): """Abstract base class for knowledge storage implementations.""" @abstractmethod def search( ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/storage/__init__.py
lib/crewai/src/crewai/knowledge/storage/__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/knowledge/source/pdf_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/pdf_knowledge_source.py
from pathlib import Path from types import ModuleType from crewai.knowledge.source.base_file_knowledge_source import BaseFileKnowledgeSource class PDFKnowledgeSource(BaseFileKnowledgeSource): """A knowledge source that stores and queries PDF file content using embeddings.""" def load_content(self) -> dict[P...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/string_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/string_knowledge_source.py
from typing import Any from pydantic import Field from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource class StringKnowledgeSource(BaseKnowledgeSource): """A knowledge source that stores and queries plain text content using embeddings.""" content: str = Field(...) collection_na...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/base_file_knowledge_source.py
from abc import ABC, abstractmethod from pathlib import Path from typing import Any from pydantic import Field, field_validator from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage from crewai.utilities.constants import K...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/excel_knowledge_source.py
from pathlib import Path from types import ModuleType from typing import Any from pydantic import Field, field_validator from crewai.knowledge.source.base_knowledge_source import BaseKnowledgeSource from crewai.utilities.constants import KNOWLEDGE_DIRECTORY from crewai.utilities.logger import Logger class ExcelKnow...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/crew_docling_source.py
lib/crewai/src/crewai/knowledge/source/crew_docling_source.py
from __future__ import annotations from collections.abc import Iterator from pathlib import Path from typing import TYPE_CHECKING, Any from urllib.parse import urlparse try: from docling.datamodel.base_models import InputFormat from docling.document_converter import DocumentConverter from docling.excepti...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/json_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/json_knowledge_source.py
import json from pathlib import Path from typing import Any from crewai.knowledge.source.base_file_knowledge_source import BaseFileKnowledgeSource class JSONKnowledgeSource(BaseFileKnowledgeSource): """A knowledge source that stores and queries JSON file content using embeddings.""" def load_content(self) -...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/base_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/base_knowledge_source.py
from abc import ABC, abstractmethod from typing import Any import numpy as np from pydantic import BaseModel, ConfigDict, Field from crewai.knowledge.storage.knowledge_storage import KnowledgeStorage class BaseKnowledgeSource(BaseModel, ABC): """Abstract base class for knowledge sources.""" chunk_size: int...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/csv_knowledge_source.py
import csv from pathlib import Path from crewai.knowledge.source.base_file_knowledge_source import BaseFileKnowledgeSource class CSVKnowledgeSource(BaseFileKnowledgeSource): """A knowledge source that stores and queries CSV file content using embeddings.""" def load_content(self) -> dict[Path, str]: ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/source/__init__.py
lib/crewai/src/crewai/knowledge/source/__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/knowledge/source/text_file_knowledge_source.py
lib/crewai/src/crewai/knowledge/source/text_file_knowledge_source.py
from pathlib import Path from crewai.knowledge.source.base_file_knowledge_source import BaseFileKnowledgeSource class TextFileKnowledgeSource(BaseFileKnowledgeSource): """A knowledge source that stores and queries text file content using embeddings.""" def load_content(self) -> dict[Path, str]: """L...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/knowledge/utils/__init__.py
lib/crewai/src/crewai/knowledge/utils/__init__.py
"""Knowledge utilities 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/knowledge/utils/knowledge_utils.py
lib/crewai/src/crewai/knowledge/utils/knowledge_utils.py
from crewai.rag.types import SearchResult def extract_knowledge_context(knowledge_snippets: list[SearchResult]) -> str: """Extract knowledge from the task prompt.""" valid_snippets = [ result["content"] for result in knowledge_snippets if result and result.get("content") ] snip...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/hooks/tool_hooks.py
lib/crewai/src/crewai/hooks/tool_hooks.py
from __future__ import annotations from typing import TYPE_CHECKING, Any from crewai.events.event_listener import event_listener from crewai.hooks.types import AfterToolCallHookType, BeforeToolCallHookType from crewai.utilities.printer import Printer if TYPE_CHECKING: from crewai.agent import Agent from cre...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/hooks/llm_hooks.py
lib/crewai/src/crewai/hooks/llm_hooks.py
from __future__ import annotations from typing import TYPE_CHECKING, Any, cast from crewai.events.event_listener import event_listener from crewai.hooks.types import AfterLLMCallHookType, BeforeLLMCallHookType from crewai.utilities.printer import Printer if TYPE_CHECKING: from crewai.agents.crew_agent_executor ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/hooks/wrappers.py
lib/crewai/src/crewai/hooks/wrappers.py
from __future__ import annotations from collections.abc import Callable from typing import TYPE_CHECKING, Any, TypeVar if TYPE_CHECKING: from crewai.hooks.llm_hooks import LLMCallHookContext from crewai.hooks.tool_hooks import ToolCallHookContext P = TypeVar("P") R = TypeVar("R") def _copy_method_metadata...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/hooks/decorators.py
lib/crewai/src/crewai/hooks/decorators.py
from __future__ import annotations from collections.abc import Callable from functools import wraps import inspect from typing import TYPE_CHECKING, Any, TypeVar, overload if TYPE_CHECKING: from crewai.hooks.llm_hooks import LLMCallHookContext from crewai.hooks.tool_hooks import ToolCallHookContext F = Type...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/hooks/__init__.py
lib/crewai/src/crewai/hooks/__init__.py
from __future__ import annotations from crewai.hooks.decorators import ( after_llm_call, after_tool_call, before_llm_call, before_tool_call, ) from crewai.hooks.llm_hooks import ( LLMCallHookContext, clear_after_llm_call_hooks, clear_all_llm_call_hooks, clear_before_llm_call_hooks, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/hooks/types.py
lib/crewai/src/crewai/hooks/types.py
from __future__ import annotations from collections.abc import Callable from typing import TYPE_CHECKING, Generic, Protocol, TypeVar, runtime_checkable if TYPE_CHECKING: from crewai.hooks.llm_hooks import LLMCallHookContext from crewai.hooks.tool_hooks import ToolCallHookContext ContextT = TypeVar("Context...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/memory.py
lib/crewai/src/crewai/memory/memory.py
from __future__ import annotations from typing import TYPE_CHECKING, Any from pydantic import BaseModel from crewai.rag.embeddings.types import EmbedderConfig if TYPE_CHECKING: from crewai.agent import Agent from crewai.task import Task class Memory(BaseModel): """Base class for memory, supporting ag...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/__init__.py
lib/crewai/src/crewai/memory/__init__.py
from crewai.memory.entity.entity_memory import EntityMemory from crewai.memory.external.external_memory import ExternalMemory from crewai.memory.long_term.long_term_memory import LongTermMemory from crewai.memory.short_term.short_term_memory import ShortTermMemory __all__ = [ "EntityMemory", "ExternalMemory"...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/storage/ltm_sqlite_storage.py
lib/crewai/src/crewai/memory/storage/ltm_sqlite_storage.py
import json from pathlib import Path import sqlite3 from typing import Any import aiosqlite from crewai.utilities import Printer from crewai.utilities.paths import db_storage_path class LTMSQLiteStorage: """SQLite storage class for long-term memory data.""" def __init__(self, db_path: str | None = None) ->...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/storage/mem0_storage.py
lib/crewai/src/crewai/memory/storage/mem0_storage.py
from collections import defaultdict from collections.abc import Iterable import os import re from typing import Any from mem0 import Memory, MemoryClient # type: ignore[import-untyped,import-not-found] from crewai.memory.storage.interface import Storage from crewai.rag.chromadb.utils import _sanitize_collection_name...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/storage/interface.py
lib/crewai/src/crewai/memory/storage/interface.py
from typing import Any class Storage: """Abstract base class defining the storage interface""" def save(self, value: Any, metadata: dict[str, Any]) -> None: pass def search( self, query: str, limit: int, score_threshold: float ) -> dict[str, Any] | list[Any]: return {} d...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/storage/kickoff_task_outputs_storage.py
lib/crewai/src/crewai/memory/storage/kickoff_task_outputs_storage.py
import json import logging from pathlib import Path import sqlite3 from typing import Any from crewai.task import Task from crewai.utilities import Printer from crewai.utilities.crew_json_encoder import CrewJSONEncoder from crewai.utilities.errors import DatabaseError, DatabaseOperationError from crewai.utilities.path...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/storage/__init__.py
lib/crewai/src/crewai/memory/storage/__init__.py
"""Memory storage implementations 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/memory/storage/rag_storage.py
lib/crewai/src/crewai/memory/storage/rag_storage.py
from __future__ import annotations import logging import traceback from typing import TYPE_CHECKING, Any, cast import warnings from crewai.rag.chromadb.config import ChromaDBConfig from crewai.rag.chromadb.types import ChromaEmbeddingFunctionWrapper from crewai.rag.config.utils import get_rag_client 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/memory/long_term/long_term_memory.py
lib/crewai/src/crewai/memory/long_term/long_term_memory.py
import time from typing import Any from crewai.events.event_bus import crewai_event_bus from crewai.events.types.memory_events import ( MemoryQueryCompletedEvent, MemoryQueryFailedEvent, MemoryQueryStartedEvent, MemorySaveCompletedEvent, MemorySaveFailedEvent, MemorySaveStartedEvent, ) from cre...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/long_term/long_term_memory_item.py
lib/crewai/src/crewai/memory/long_term/long_term_memory_item.py
from typing import Any class LongTermMemoryItem: def __init__( self, agent: str, task: str, expected_output: str, datetime: str, quality: int | float | None = None, metadata: dict[str, Any] | None = None, ): self.task = task self.agent = ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/long_term/__init__.py
lib/crewai/src/crewai/memory/long_term/__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/memory/external/external_memory_item.py
lib/crewai/src/crewai/memory/external/external_memory_item.py
from typing import Any class ExternalMemoryItem: def __init__( self, value: Any, metadata: dict[str, Any] | None = None, agent: str | None = None, ): self.value = value self.metadata = metadata self.agent = agent
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/external/__init__.py
lib/crewai/src/crewai/memory/external/__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/memory/external/external_memory.py
lib/crewai/src/crewai/memory/external/external_memory.py
from __future__ import annotations import time from typing import TYPE_CHECKING, Any from crewai.events.event_bus import crewai_event_bus from crewai.events.types.memory_events import ( MemoryQueryCompletedEvent, MemoryQueryFailedEvent, MemoryQueryStartedEvent, MemorySaveCompletedEvent, MemorySave...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/contextual/__init__.py
lib/crewai/src/crewai/memory/contextual/__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/memory/contextual/contextual_memory.py
lib/crewai/src/crewai/memory/contextual/contextual_memory.py
from __future__ import annotations import asyncio from typing import TYPE_CHECKING from crewai.memory import ( EntityMemory, ExternalMemory, LongTermMemory, ShortTermMemory, ) if TYPE_CHECKING: from crewai.agent import Agent from crewai.task import Task class ContextualMemory: """Aggre...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/entity/entity_memory_item.py
lib/crewai/src/crewai/memory/entity/entity_memory_item.py
class EntityMemoryItem: def __init__( self, name: str, type: str, description: str, relationships: str, ): self.name = name self.type = type self.description = description self.metadata = {"relationships": relationships}
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/entity/entity_memory.py
lib/crewai/src/crewai/memory/entity/entity_memory.py
import time from typing import Any from pydantic import PrivateAttr from crewai.events.event_bus import crewai_event_bus from crewai.events.types.memory_events import ( MemoryQueryCompletedEvent, MemoryQueryFailedEvent, MemoryQueryStartedEvent, MemorySaveCompletedEvent, MemorySaveFailedEvent, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/entity/__init__.py
lib/crewai/src/crewai/memory/entity/__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/memory/short_term/short_term_memory.py
lib/crewai/src/crewai/memory/short_term/short_term_memory.py
from __future__ import annotations import time from typing import Any from pydantic import PrivateAttr from crewai.events.event_bus import crewai_event_bus from crewai.events.types.memory_events import ( MemoryQueryCompletedEvent, MemoryQueryFailedEvent, MemoryQueryStartedEvent, MemorySaveCompletedEv...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/short_term/short_term_memory_item.py
lib/crewai/src/crewai/memory/short_term/short_term_memory_item.py
from typing import Any class ShortTermMemoryItem: def __init__( self, data: Any, agent: str | None = None, metadata: dict[str, Any] | None = None, ): self.data = data self.agent = agent self.metadata = metadata if metadata is not None else {}
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/memory/short_term/__init__.py
lib/crewai/src/crewai/memory/short_term/__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/project/wrappers.py
lib/crewai/src/crewai/project/wrappers.py
"""Wrapper classes for decorated methods with type-safe metadata.""" from __future__ import annotations import asyncio from collections.abc import Callable from functools import partial import inspect from pathlib import Path from typing import ( TYPE_CHECKING, Any, Generic, Literal, ParamSpec, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/project/annotations.py
lib/crewai/src/crewai/project/annotations.py
"""Decorators for defining crew components and their behaviors.""" from __future__ import annotations import asyncio from collections.abc import Callable from functools import wraps import inspect from typing import TYPE_CHECKING, Any, Concatenate, ParamSpec, TypeVar, overload from crewai.project.utils import memoiz...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/project/crew_base.py
lib/crewai/src/crewai/project/crew_base.py
"""Base metaclass for creating crew classes with configuration and method management.""" from __future__ import annotations from collections.abc import Callable import inspect import logging from pathlib import Path from typing import ( TYPE_CHECKING, Any, Literal, TypeGuard, TypeVar, TypedDic...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/project/utils.py
lib/crewai/src/crewai/project/utils.py
"""Utility functions for the crewai project module.""" from collections.abc import Callable, Coroutine from functools import wraps import inspect from typing import Any, ParamSpec, TypeVar, cast from pydantic import BaseModel from crewai.agents.cache.cache_handler import CacheHandler P = ParamSpec("P") R = TypeVar...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/project/__init__.py
lib/crewai/src/crewai/project/__init__.py
"""Project package for CrewAI.""" from crewai.project.annotations import ( after_kickoff, agent, before_kickoff, cache_handler, callback, crew, llm, output_json, output_pydantic, task, tool, ) from crewai.project.crew_base import CrewBase __all__ = [ "CrewBase", "a...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/constants.py
lib/crewai/src/crewai/llms/constants.py
from typing import Literal, TypeAlias OpenAIModels: TypeAlias = Literal[ "gpt-3.5-turbo", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-16k-0613", "gpt-3.5-turbo-instruct", "gpt-3.5-turbo-instruct-0914", ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/base_llm.py
lib/crewai/src/crewai/llms/base_llm.py
"""Base LLM abstract class for CrewAI. This module provides the abstract base class for all LLM implementations in CrewAI, including common functionality for native SDK implementations. """ from __future__ import annotations from abc import ABC, abstractmethod from datetime import datetime import json import logging...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/__init__.py
lib/crewai/src/crewai/llms/__init__.py
"""LLM implementations 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/llms/third_party/__init__.py
lib/crewai/src/crewai/llms/third_party/__init__.py
"""Third-party LLM implementations 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/llms/hooks/transport.py
lib/crewai/src/crewai/llms/hooks/transport.py
"""HTTP transport implementations for LLM request/response interception. This module provides internal transport classes that integrate with BaseInterceptor to enable request/response modification at the transport level. """ from __future__ import annotations from collections.abc import Iterable from typing import T...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/hooks/__init__.py
lib/crewai/src/crewai/llms/hooks/__init__.py
"""Interceptor contracts for crewai""" from crewai.llms.hooks.base import BaseInterceptor __all__ = ["BaseInterceptor"]
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/hooks/base.py
lib/crewai/src/crewai/llms/hooks/base.py
"""Base classes for LLM transport interceptors. This module provides abstract base classes for intercepting and modifying outbound and inbound messages at the transport level. """ from __future__ import annotations from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, Generic, TypeVar from pyda...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/__init__.py
lib/crewai/src/crewai/llms/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/llms/providers/openai/completion.py
lib/crewai/src/crewai/llms/providers/openai/completion.py
from __future__ import annotations from collections.abc import AsyncIterator import json import logging import os from typing import TYPE_CHECKING, Any import httpx from openai import APIConnectionError, AsyncOpenAI, NotFoundError, OpenAI, Stream from openai.lib.streaming.chat import ChatCompletionStream from openai....
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/openai/__init__.py
lib/crewai/src/crewai/llms/providers/openai/__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/llms/providers/azure/completion.py
lib/crewai/src/crewai/llms/providers/azure/completion.py
from __future__ import annotations import json import logging import os from typing import TYPE_CHECKING, Any, TypedDict from pydantic import BaseModel from typing_extensions import Self from crewai.utilities.agent_utils import is_context_length_exceeded from crewai.utilities.exceptions.context_window_exceeding_exce...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/azure/__init__.py
lib/crewai/src/crewai/llms/providers/azure/__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/llms/providers/utils/common.py
lib/crewai/src/crewai/llms/providers/utils/common.py
import logging import re from typing import Any def validate_function_name(name: str, provider: str = "LLM") -> str: """Validate function name according to common LLM provider requirements. Most LLM providers (OpenAI, Gemini, Anthropic) have similar requirements: - Must start with letter or underscore ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/utils/__init__.py
lib/crewai/src/crewai/llms/providers/utils/__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/llms/providers/bedrock/completion.py
lib/crewai/src/crewai/llms/providers/bedrock/completion.py
from __future__ import annotations from collections.abc import Mapping, Sequence from contextlib import AsyncExitStack import json import logging import os from typing import TYPE_CHECKING, Any, TypedDict, cast from pydantic import BaseModel from typing_extensions import Required from crewai.events.types.llm_events ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/bedrock/__init__.py
lib/crewai/src/crewai/llms/providers/bedrock/__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/llms/providers/anthropic/completion.py
lib/crewai/src/crewai/llms/providers/anthropic/completion.py
from __future__ import annotations import json import logging import os from typing import TYPE_CHECKING, Any, Literal, cast from anthropic.types import ThinkingBlock from pydantic import BaseModel from crewai.events.types.llm_events import LLMCallType from crewai.llms.base_llm import BaseLLM from crewai.llms.hooks....
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/anthropic/__init__.py
lib/crewai/src/crewai/llms/providers/anthropic/__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/llms/providers/gemini/completion.py
lib/crewai/src/crewai/llms/providers/gemini/completion.py
from __future__ import annotations import logging import os import re from typing import TYPE_CHECKING, Any, Literal, cast from pydantic import BaseModel from crewai.events.types.llm_events import LLMCallType from crewai.llms.base_llm import BaseLLM from crewai.utilities.agent_utils import is_context_length_exceeded...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/llms/providers/gemini/__init__.py
lib/crewai/src/crewai/llms/providers/gemini/__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/types/hitl.py
lib/crewai/src/crewai/types/hitl.py
"""Human-in-the-loop (HITL) type definitions. This module provides type definitions for human-in-the-loop interactions in crew executions. """ from typing import TypedDict class HITLResumeInfo(TypedDict, total=False): """HITL resume information passed from flow to crew. Attributes: task_id: Unique ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/types/streaming.py
lib/crewai/src/crewai/types/streaming.py
"""Streaming output types for crew and flow execution.""" from __future__ import annotations from collections.abc import AsyncIterator, Iterator from enum import Enum from typing import TYPE_CHECKING, Any, Generic, TypeVar from pydantic import BaseModel, Field if TYPE_CHECKING: from crewai.crews.crew_output im...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/types/utils.py
lib/crewai/src/crewai/types/utils.py
"""Utilities for creating and manipulating types.""" from typing import Annotated, Final, Literal from typing_extensions import TypeAliasType _DYNAMIC_LITERAL_ALIAS: Final[Literal["DynamicLiteral"]] = "DynamicLiteral" def create_literals_from_strings( values: Annotated[ tuple[str, ...], "Should contai...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/types/usage_metrics.py
lib/crewai/src/crewai/types/usage_metrics.py
"""Usage metrics tracking for CrewAI execution. This module provides models for tracking token usage and request metrics during crew and agent execution. """ from pydantic import BaseModel, Field from typing_extensions import Self class UsageMetrics(BaseModel): """Track usage metrics for crew execution. At...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/types/__init__.py
lib/crewai/src/crewai/types/__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/types/crew_chat.py
lib/crewai/src/crewai/types/crew_chat.py
"""Crew chat input models. This module provides models for defining chat inputs and fields for crew interactions. """ from pydantic import BaseModel, Field class ChatInputField(BaseModel): """Represents a single required input for the crew. Example: ```python field = ChatInputField( ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/event_types.py
lib/crewai/src/crewai/events/event_types.py
from crewai.events.types.agent_events import ( AgentExecutionCompletedEvent, AgentExecutionErrorEvent, AgentExecutionStartedEvent, LiteAgentExecutionCompletedEvent, ) from crewai.events.types.crew_events import ( CrewKickoffCompletedEvent, CrewKickoffFailedEvent, CrewKickoffStartedEvent, ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/base_event_listener.py
lib/crewai/src/crewai/events/base_event_listener.py
"""Base event listener for CrewAI event system.""" from abc import ABC, abstractmethod from crewai.events.event_bus import CrewAIEventsBus, crewai_event_bus class BaseEventListener(ABC): """Abstract base class for event listeners.""" verbose: bool = False def __init__(self) -> None: """Initial...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/event_listener.py
lib/crewai/src/crewai/events/event_listener.py
from __future__ import annotations from io import StringIO from typing import TYPE_CHECKING, Any from pydantic import Field, PrivateAttr from crewai.events.base_event_listener import BaseEventListener from crewai.events.listeners.tracing.trace_listener import TraceCollectionListener from crewai.events.types.a2a_even...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/handler_graph.py
lib/crewai/src/crewai/events/handler_graph.py
"""Dependency graph resolution for event handlers. This module resolves handler dependencies into execution levels, ensuring handlers execute in correct order while maximizing parallelism. """ from collections import defaultdict, deque from collections.abc import Sequence from crewai.events.depends import Depends fr...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/depends.py
lib/crewai/src/crewai/events/depends.py
"""Dependency injection system for event handlers. This module provides a FastAPI-style dependency system that allows event handlers to declare dependencies on other handlers, ensuring proper execution order while maintaining parallelism where possible. """ from collections.abc import Coroutine from typing import Any...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/event_bus.py
lib/crewai/src/crewai/events/event_bus.py
"""Event bus for managing and dispatching events in CrewAI. This module provides a singleton event bus that allows registration and handling of events throughout the CrewAI system, supporting both synchronous and asynchronous event handlers with optional dependency management. """ import asyncio import atexit from co...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/__init__.py
lib/crewai/src/crewai/events/__init__.py
"""CrewAI events system for monitoring and extending agent behavior. This module provides the event infrastructure that allows users to: - Monitor agent, task, and crew execution - Track memory operations and performance - Build custom logging and analytics - Extend CrewAI with custom event handlers - Declare handler ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/base_events.py
lib/crewai/src/crewai/events/base_events.py
from datetime import datetime, timezone from typing import Any from pydantic import BaseModel, Field from crewai.utilities.serialization import to_serializable class BaseEvent(BaseModel): """Base class for all events""" timestamp: datetime = Field(default_factory=lambda: datetime.now(timezone.utc)) typ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/utils/console_formatter.py
lib/crewai/src/crewai/events/utils/console_formatter.py
import threading from typing import Any, ClassVar from rich.console import Console from rich.live import Live from rich.panel import Panel from rich.text import Text class ConsoleFormatter: tool_usage_counts: ClassVar[dict[str, int]] = {} current_a2a_turn_count: int = 0 _pending_a2a_message: str | None ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
true
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/utils/__init__.py
lib/crewai/src/crewai/events/utils/__init__.py
"""Event utilities 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/events/utils/handlers.py
lib/crewai/src/crewai/events/utils/handlers.py
"""Handler utility functions for event processing.""" import functools import inspect from typing import Any from typing_extensions import TypeIs from crewai.events.base_events import BaseEvent from crewai.events.types.event_bus_types import AsyncHandler, SyncHandler def is_async_handler( handler: Any, ) -> Ty...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/types/logging_events.py
lib/crewai/src/crewai/events/types/logging_events.py
"""Agent logging events that don't reference BaseAgent to avoid circular imports.""" from typing import Any from pydantic import ConfigDict from crewai.events.base_events import BaseEvent class AgentLogsStartedEvent(BaseEvent): """Event emitted when agent logs should be shown at start""" agent_role: str ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/types/task_events.py
lib/crewai/src/crewai/events/types/task_events.py
from typing import Any from crewai.events.base_events import BaseEvent from crewai.tasks.task_output import TaskOutput class TaskStartedEvent(BaseEvent): """Event emitted when a task starts""" type: str = "task_started" context: str | None task: Any | None = None def __init__(self, **data): ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/types/reasoning_events.py
lib/crewai/src/crewai/events/types/reasoning_events.py
from typing import Any from crewai.events.base_events import BaseEvent class ReasoningEvent(BaseEvent): """Base event for reasoning events.""" type: str attempt: int = 1 agent_role: str task_id: str task_name: str | None = None from_task: Any | None = None agent_id: str | None = None...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/types/tool_usage_events.py
lib/crewai/src/crewai/events/types/tool_usage_events.py
from collections.abc import Callable from datetime import datetime from typing import Any from pydantic import ConfigDict from crewai.events.base_events import BaseEvent class ToolUsageEvent(BaseEvent): """Base event for tool usage tracking""" agent_key: str | None = None agent_role: str | None = None ...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false
crewAIInc/crewAI
https://github.com/crewAIInc/crewAI/blob/f3c17a249b5a2da3a917784d9762421591c1cde5/lib/crewai/src/crewai/events/types/knowledge_events.py
lib/crewai/src/crewai/events/types/knowledge_events.py
from typing import Any from crewai.events.base_events import BaseEvent class KnowledgeEventBase(BaseEvent): task_id: str | None = None task_name: str | None = None from_task: Any | None = None from_agent: Any | None = None agent_role: str | None = None agent_id: str | None = None def __i...
python
MIT
f3c17a249b5a2da3a917784d9762421591c1cde5
2026-01-04T14:39:52.484392Z
false