View module source on GitHub

is_primitive

def is_primitive(obj: Any) -> bool

Check if an object is a known primitive type.

dictify

def dictify(obj: Any,
            maxdepth: int = 0,
            depth: int = 1,
            seen: Union[set[int], None] = None) -> Any

Recursively compute a dictionary representation of an object.

stringify

def stringify(obj: Any, limit: int = MAX_STR_LEN) -> str

This is a fallback for objects that we don’t have a better way to serialize.

serialize_crewai_objects

def serialize_crewai_objects(obj: Any) -> Any

Safely serialize CrewAI objects to prevent recursion.

crewai_postprocess_inputs

def crewai_postprocess_inputs(inputs: dict[str, Any]) -> dict[str, Any]

Process CrewAI inputs to prevent recursion.

crew_kickoff_postprocess_inputs

def crew_kickoff_postprocess_inputs(inputs: dict[str, Any]) -> dict[str, Any]

Postprocess the inputs to the Crew.kickoff method.

The method has a self which should be an instance of Crew which is a pydantic model. The method also has an inputs which is a dict or list[dict] of arguments to pass to the kickoff method.