This project is an AI agent designed to help you manage your fantasy football team. It utilizes LangChain to integrate various tools, including statistics retrieval, web search for the latest news, team management, trade evaluation, and waiver wire monitoring.
- Statistics Retrieval: Access and analyze player stats from provided data frames.
- Web Search: Get the latest news and updates on players using an AI-powered search service.
- Team Management: Interact with your CBS dynasty PPR league to get and update your team roster.
- Trade Evaluation: Analyze potential trades to maximize your team's performance.
- Waiver Wire Monitoring: Check available players and place waiver claims when a player becomes valuable.
- Python 3.8 or higher
- LangChain
- Required Python packages (listed in
requirements.txt)
-
Clone the Repository
git clone https://github.com/yourusername/fantasy_football_ai.git cd fantasy_football_ai -
Create a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
API Keys
- OpenAI API Key: Sign up for an OpenAI account and obtain an API key.
- Web Search Tool: Sign up for the AI-powered search service (e.g., Perplexity AI) and obtain an API key.
- Team Management Tool: Ensure you have access to the CBS Sports API and obtain necessary credentials.
-
Environment Variables
Create a
.envfile in the root directory with the following:OPENAI_API_KEY=your_openai_api_key AI_SEARCH_API_KEY=your_ai_search_api_key CBS_API_KEY=your_cbs_api_key CBS_USERNAME=your_cbs_username CBS_PASSWORD=your_cbs_password
Run the main script to start the AI agent:
python main.py-
Fantasy Agent (
agent/fantasy_agent.py)Implements the AI agent using LangChain, integrating all tools and providing a natural language interface.
-
Stats Retriever (
tools/stats_retriever.py)Retrieves and processes player statistics from the provided data frames.
-
Web Search (
tools/web_search.py)Uses an AI-powered search service to fetch the latest news on players.
-
Team Manager (
tools/team_manager.py)Interacts with the CBS Sports API to manage your team roster.
-
Trade Evaluator (
tools/trade_evaluator.py)Analyzes potential trades based on player performance and projections.
-
Waiver Wire Monitor (
tools/waiver_wire.py)Checks for available players and places waiver claims when necessary.
-
Stats DataFrames (
data/stats_dataframes.py)Contains the data frames with player statistics and other relevant data.
This project is licensed under the MIT License.