Exploring practical implementations
To demonstrate how various AI/ML frameworks can be used to create intelligent agents capable of executing complex tasks through tool use and planning, let’s explore examples using CrewAI, AutoGen, and LangGraph (the agentic framework of LangChain). You can find the full code for each of the framework examples in the Chapter_05.ipynb
Python notebook in the GitHub repository.
CrewAI example
Let’s examine how CrewAI implements tool-based reasoning through a practical travel planning example. The framework’s Python library provides a @tool
decorator that allows us to define tools with clear descriptions and documentation. Here’s how we can create a set of travel-related tools:
1 @tool("Search for available flights between cities") 2 def search_flights(...) -> dict: 3 """Search for available flights between cities.""" 4 # Call...