What this doc covers
- How to set up a crew, agents and a custom Exa-powered tool
- Designing these in service of generating a newsletter based on Exa search results
Guide
1. Pre-requisites and installation
Install the crewAI core, crewAI tools and Exa Python SDK librariesPython
2. Defining a custom Exa-based tool in crewAI
In the following code, we set up a custom tool using the crewAI @tool decorator . Within the tool, we initialize the Exa class from the Exa Python SDK, make a request, and return a parsed out result.Python
OPENAI_API_KEY and EXA_API_KEY for OpenAI and Exa keys respectively.
Get Exa API Key
Follow this link to get your API key
3. Setting up CrewAI agent and kicking off
First import the relevant crewAI modules. We explicitly defineexa_tools here per the above method definition for use by our agents
Python
Python
Python
= crew.kickoff(inputs={'topic': 'Latest AI research'})
Stdout

