This project implements a recipe extraction agent using the Langchain framework. It is designed to extract structured recipe information such as the title, ingredients, instructions, cooking time, and servings from unstructured text, with a focus on processing transcripts from cooking YouTube videos.
- Extracts key recipe details: Identifies the recipe title, URL (if available), ingredients with quantities, step-by-step instructions, cooking time, and the number of servings
- Processes YouTube transcripts: Specifically built to analyze and extract information from YouTube video transcripts
- Handles messy or incomplete transcripts: Attempts to make educated guesses about missing information and provides reasonable estimates for vague measurements
- Outputs in Markdown format: The extracted recipe is formatted as a clean and readable Markdown string
- Utilizes Langchain: Leverages the power of Langchain for text processing, prompting, and agent creation
- Integrates with OpenAI: Uses OpenAI models (like
gpt-4o) for understanding and extracting recipe information - Includes tools for YouTube search: Can search YouTube for relevant cooking videos
To use this recipe extraction agent, you'll need to follow these steps:
-
Clone the repository:
git clone https://github.com/raym26/recipe-extraction-agent-langchain.git cd recipe-extraction-agent-langchain -
Install the required Python packages: It's recommended to use a virtual environment. If you have a
requirements.txtfile, you can install all dependencies using pip:pip install -r requirements.txt
-
Set up environment variables: This project likely requires an OpenAI API key. You might need to create a
.envfile in the project root and add your API key:OPENAI_API_KEY=YOUR_OPENAI_API_KEY