mirror of
https://github.com/crewAIInc/crewAI-examples.git
synced 2026-04-23 03:00:08 -04:00
Clean up reames
This commit is contained in:
@@ -1,39 +1,99 @@
|
||||
# Email Auto Responder Flow
|
||||
|
||||
## Introduction
|
||||
Welcome to the Email Auto Responder Flow project, powered by [crewAI](https://crewai.com). This example demonstrates how you can leverage Flows from crewAI to automate the process of checking emails and creating draft responses. By utilizing Flows, the process becomes much simpler and more efficient.
|
||||
|
||||
Welcome to the Email Auto Responder Flow project, powered by [crewAI](https://crewai.com). This example demonstrates how you can leverage Flows from crewAI to accomplish tasks that previously required LangGraph. By utilizing Flows, the process becomes much simpler and more efficient.
|
||||
## Background
|
||||
|
||||
In this project, we've taken one of our old example repositories, [CrewAI-LangGraph](https://github.com/crewAIInc/crewAI-examples/tree/main/CrewAI-LangGraph), and repurposed it to now use Flows. This showcases the power and simplicity of Flows in orchestrating AI agents to automate tasks like checking emails and creating drafts.
|
||||
In this project, we've taken one of our old example repositories, [CrewAI-LangGraph](https://github.com/crewAIInc/crewAI-examples/tree/main/CrewAI-LangGraph), and repurposed it to now use Flows. This showcases the power and simplicity of Flows in orchestrating AI agents to automate tasks like checking emails and creating drafts. Flows provide a more straightforward and powerful alternative to LangGraph, making it easier to build and manage complex workflows.
|
||||
|
||||
### High-Level Diagram
|
||||
|
||||
Below is a high-level diagram of the Email Auto Responder Flow:
|
||||
|
||||

|
||||
|
||||
- [CrewAI Framework](#crewai-framework)
|
||||
- [Running the Code](#running-the-code)
|
||||
- [Details & Explanation](#details--explanation)
|
||||
- [License](#license)
|
||||
This diagram illustrates the flow of tasks from fetching new emails to generating draft responses.
|
||||
|
||||
## CrewAI Framework
|
||||
## Overview
|
||||
|
||||
CrewAI is designed to facilitate the collaboration of role-playing AI agents. In this example, these agents work together using Flows to automatically check emails and create draft responses. Flows simplify the orchestration process, making it more straightforward than previous implementations with LangGraph.
|
||||
This flow will guide you through the process of setting up an automated email responder. Here's a brief overview of what will happen in this flow:
|
||||
|
||||
## Running the Code
|
||||
1. **Fetch New Emails**: The flow starts by using the `EmailFilterCrew` to check for new emails. It updates the state with any new emails and their IDs.
|
||||
|
||||
This example uses GPT-4o.
|
||||
2. **Generate Draft Responses**: Once new emails are fetched, the flow formats these emails and uses the `EmailFilterCrew` to generate draft responses for each email.
|
||||
|
||||
- **Configure Environment**: Copy `.env.example` to `.env` and set up your environment variables, including your `OPENAI_API_KEY`.
|
||||
- **Setup a `credentials.json`**: Follow the [Google Gmail API instructions](https://developers.google.com/gmail/api/quickstart/python#authorize_credentials_for_a_desktop_application). Once you’ve downloaded the file, name it `credentials.json` and add it to the root of the project.
|
||||
- **Install Dependencies**: Run `poetry install`
|
||||
- **Execute the Script**: First open the new shell with the poetry environment by running `poetry shell`. Then run `crewai run`.
|
||||
This flow is a great example of using Flows as a background worker that runs continuously to help you out. By following this flow, you can efficiently automate the process of checking emails and generating draft responses, leveraging the power of multiple AI agents to handle different aspects of the email processing workflow.
|
||||
|
||||
## Details & Explanation
|
||||
## Installation
|
||||
|
||||
- **Key Components**:
|
||||
- `./src/email_auto_responder_flow/main.py`: Main script that initiates the flow.
|
||||
- `./src/email_auto_responder_flow/crews/email_filter_crew/`: Contains the crew definition using Flows.
|
||||
- `./src/email_auto_responder_flow/utils/`: Utility functions for email processing.
|
||||
- `./src/email_auto_responder_flow/types.py`: Defines the data models used in the project.
|
||||
Ensure you have Python >=3.10 <=3.13 installed on your system. This project uses [Poetry](https://python-poetry.org/) for dependency management and package handling, offering a seamless setup and execution experience.
|
||||
|
||||
## License
|
||||
First, if you haven't already, install Poetry:
|
||||
|
||||
This project is released under the MIT License.
|
||||
```bash
|
||||
pip install poetry
|
||||
```
|
||||
|
||||
Next, navigate to your project directory and install the dependencies:
|
||||
|
||||
1. First lock the dependencies and then install them:
|
||||
|
||||
```bash
|
||||
crewai install
|
||||
```
|
||||
|
||||
### Customizing & Dependencies
|
||||
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `SERPER_API_KEY` into the `.env` file**
|
||||
**Add your `TAVILY_API_KEY` into the `.env` file**
|
||||
**Add your `MY_EMAIL` into the `.env` file**
|
||||
|
||||
To customize the behavior of the email auto responder, you can update the agents and tasks defined in the `EmailFilterCrew`. If you want to adjust the flow itself, you will need to modify the flow in `main.py`.
|
||||
|
||||
- **Agents and Tasks**: Modify `src/email_auto_responder_flow/crews/email_filter_crew/email_filter_crew.py` to define your agents and tasks. This is where you can customize how emails are filtered and how draft responses are generated.
|
||||
|
||||
- **Flow Adjustments**: Modify `src/email_auto_responder_flow/main.py` to adjust the flow. This is where you can change how the flow orchestrates the different crews and tasks.
|
||||
|
||||
### Setting Up Google Credentials
|
||||
|
||||
To enable the email auto responder to access your Gmail account, you need to set up a `credentials.json` file. Follow these steps:
|
||||
|
||||
1. **Set Up Google Account**: Follow the [Google instructions](https://developers.google.com/gmail/api/quickstart/python#authorize_credentials_for_a_desktop_application) to set up your Google account and obtain the `credentials.json` file.
|
||||
|
||||
2. **Download and Place `credentials.json`**: Once you’ve downloaded the file, name it `credentials.json` and place it in the root of the project.
|
||||
|
||||
## Running the Project
|
||||
|
||||
To kickstart your crew of AI agents and begin task execution, run this from the root folder of your project:
|
||||
|
||||
```bash
|
||||
crewai run
|
||||
```
|
||||
|
||||
This command initializes the email_auto_responder_flow, assembling the agents and assigning them tasks as defined in your configuration.
|
||||
|
||||
When you kickstart the flow, it will orchestrate multiple crews to perform the tasks. The flow will first fetch new emails, then create and run a crew to generate draft responses.
|
||||
|
||||
## Understanding Your Flow
|
||||
|
||||
The email_auto_responder_flow is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your flow.
|
||||
|
||||
### Flow Structure
|
||||
|
||||
1. **EmailFilterCrew**: This crew is responsible for checking for new emails and updating the state with any new emails and their IDs.
|
||||
|
||||
2. **Generate Draft Responses**: Once new emails are fetched, this step formats the emails and uses the `EmailFilterCrew` to generate draft responses for each email.
|
||||
|
||||
By understanding the flow structure, you can see how multiple crews are orchestrated to work together, each handling a specific part of the email processing workflow. This modular approach allows for efficient and scalable email automation.
|
||||
|
||||
## Support
|
||||
|
||||
For support, questions, or feedback regarding the Email Auto Responder Flow or crewAI:
|
||||
|
||||
- Visit our [documentation](https://docs.crewai.com)
|
||||
- Reach out to us through our [GitHub repository](https://github.com/joaomdmoura/crewai)
|
||||
- [Join our Discord](https://discord.com/invite/X4JWnZnxPb)
|
||||
- [Chat with our docs](https://chatg.pt/DWjSBZn)
|
||||
|
||||
Let's create wonders together with the power and simplicity of crewAI.
|
||||
|
||||
@@ -44,12 +44,6 @@ class EmailAutoResponderFlow(Flow[AutoResponderState]):
|
||||
print("Waiting for 180 seconds")
|
||||
time.sleep(180)
|
||||
|
||||
@listen(generate_draft_responses)
|
||||
def save_to_a_excel(self):
|
||||
print("Saving to excel")
|
||||
|
||||
pass
|
||||
|
||||
|
||||
async def run():
|
||||
"""
|
||||
@@ -61,25 +55,6 @@ async def run():
|
||||
|
||||
def main():
|
||||
asyncio.run(run())
|
||||
# emails = """
|
||||
# EMAILS ID: 191fb61dc03a7c47
|
||||
# - Thread ID: 191fb10965995fa5
|
||||
# - Snippet: @monami44 pushed 1 commit. ba31f59 simple stuck, lock — View it on GitHub or unsubscribe. You are receiving this because you are subscribed to this thread. Message ID: <bhancockio/fullstack-ai-
|
||||
# - From: Maksym <notifications@github.com>
|
||||
# --------
|
||||
# ID: 191fb22a49692a31
|
||||
# - Thread ID: 191fb22a49692a31
|
||||
# - Snippet: Hi Brandon, I'm excited to share something revolutionary in the AI space with you. Our latest video dives deep into the capabilities of advanced AI bots and how they can transform your business.
|
||||
# - From: James Hurst <james@jameshurst.ddxweb.com>
|
||||
# --------
|
||||
# ID: 191f856c481fc45b
|
||||
# - Thread ID: 191f7338692ab387
|
||||
# - Snippet: Meeting summary with AI Companion now supports additional languages in preview. Learn More Meeting summary for Brandon Hancock's Zoom Meeting (09/16/2024) Quick recap Brandon and Maksym discussed
|
||||
# - From: Meeting Summary with AI Companion <no-reply@zoom.us>
|
||||
# --------
|
||||
# """
|
||||
|
||||
# EmailFilterCrew().crew().kickoff(inputs={"emails": emails})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -1,6 +1,20 @@
|
||||
# {{crew_name}} Crew
|
||||
# Lead Score Flow
|
||||
|
||||
Welcome to the {{crew_name}} Crew project, powered by [crewAI](https://crewai.com). This template is designed to help you set up a multi-agent AI system with ease, leveraging the powerful and flexible framework provided by crewAI. Our goal is to enable your agents to collaborate effectively on complex tasks, maximizing their collective intelligence and capabilities.
|
||||
Welcome to the Lead Score Flow project, powered by [crewAI](https://crewai.com). This example demonstrates how you can leverage Flows from crewAI to automate the process of scoring leads, including data collection, analysis, and scoring. By utilizing Flows, the process becomes much simpler and more efficient.
|
||||
|
||||
## Overview
|
||||
|
||||
This flow will guide you through the process of setting up an automated lead scoring system. Here's a brief overview of what will happen in this flow:
|
||||
|
||||
1. **Load Leads**: The flow starts by loading lead data from a CSV file named `leads.csv`.
|
||||
|
||||
2. **Score Leads**: The `LeadScoreCrew` is kicked off to score the loaded leads based on predefined criteria.
|
||||
|
||||
3. **Human in the Loop**: The top 3 candidates are presented for human review, allowing for additional feedback or proceeding with writing emails.
|
||||
|
||||
4. **Write and Save Emails**: Emails are generated and saved for all leads, with special attention to the top 3 candidates.
|
||||
|
||||
By following this flow, you can efficiently automate the process of scoring leads, leveraging the power of multiple AI agents to handle different aspects of the lead scoring workflow.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -20,14 +34,16 @@ Next, navigate to your project directory and install the dependencies:
|
||||
crewai install
|
||||
```
|
||||
|
||||
### Customizing
|
||||
### Customizing & Dependencies
|
||||
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `SERPER_API_KEY` into the `.env` file**
|
||||
|
||||
- Modify `src/write_a_book_with_flows/config/agents.yaml` to define your agents
|
||||
- Modify `src/write_a_book_with_flows/config/tasks.yaml` to define your tasks
|
||||
- Modify `src/write_a_book_with_flows/crew.py` to add your own logic, tools and specific args
|
||||
- Modify `src/write_a_book_with_flows/main.py` to add custom inputs for your agents and tasks
|
||||
To customize the behavior of the lead score flow, you can update the agents and tasks defined in the `LeadDataCollectionCrew`, `LeadAnalysisCrew`, and `LeadScoringCrew`. If you want to adjust the flow itself, you will need to modify the flow in `main.py`.
|
||||
|
||||
- **Agents and Tasks**: Modify `src/lead_score_flow/config/agents.yaml` to define your agents and `src/lead_score_flow/config/tasks.yaml` to define your tasks. This is where you can customize how lead data is collected, analyzed, and scored.
|
||||
|
||||
- **Flow Adjustments**: Modify `src/lead_score_flow/main.py` to adjust the flow. This is where you can change how the flow orchestrates the different crews and tasks.
|
||||
|
||||
## Running the Project
|
||||
|
||||
@@ -37,17 +53,31 @@ To kickstart your crew of AI agents and begin task execution, run this from the
|
||||
crewai run
|
||||
```
|
||||
|
||||
This command initializes the write_a_book_with_flows Crew, assembling the agents and assigning them tasks as defined in your configuration.
|
||||
This command initializes the lead_score_flow, assembling the agents and assigning them tasks as defined in your configuration.
|
||||
|
||||
This example, unmodified, will run the create a `report.md` file with the output of a research on LLMs in the root folder.
|
||||
When you kickstart the flow, it will orchestrate multiple crews to perform the tasks. The flow will first collect lead data, then analyze the data, score the leads, save the scores to a CSV file, and generate email drafts.
|
||||
|
||||
## Understanding Your Crew
|
||||
## Understanding Your Flow
|
||||
|
||||
The write_a_book_with_flows Crew is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your crew.
|
||||
The lead_score_flow is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your flow.
|
||||
|
||||
### Flow Structure
|
||||
|
||||
1. **Collect Lead Data**: This step collects lead data from various sources.
|
||||
|
||||
2. **Analyze Lead Data**: The `LeadAnalysisCrew` is kicked off to analyze the collected lead data.
|
||||
|
||||
3. **Score Leads**: The analyzed data is then used to score the leads based on predefined criteria.
|
||||
|
||||
4. **Save Lead Scores**: The lead scores are saved to a CSV file named `lead_scores.csv`.
|
||||
|
||||
5. **Write and Save Emails**: Emails are generated and saved for all leads, with special attention to the top 3 candidates.
|
||||
|
||||
By understanding the flow structure, you can see how multiple crews are orchestrated to work together, each handling a specific part of the lead scoring process. This modular approach allows for efficient and scalable lead scoring automation.
|
||||
|
||||
## Support
|
||||
|
||||
For support, questions, or feedback regarding the {{crew_name}} Crew or crewAI.
|
||||
For support, questions, or feedback regarding the Lead Score Flow or crewAI:
|
||||
|
||||
- Visit our [documentation](https://docs.crewai.com)
|
||||
- Reach out to us through our [GitHub repository](https://github.com/joaomdmoura/crewai)
|
||||
|
||||
@@ -117,17 +117,17 @@ class EmailAutoResponderFlow(Flow[LeadScoreState]):
|
||||
return "scored_leads_feedback"
|
||||
elif choice == "3":
|
||||
print("\nProceeding to write emails to all leads.")
|
||||
return "write_emails"
|
||||
return "generate_emails"
|
||||
else:
|
||||
print("\nInvalid choice. Please try again.")
|
||||
return "human_in_the_loop"
|
||||
|
||||
@listen("write_emails")
|
||||
async def send_emails(self):
|
||||
@listen("generate_emails")
|
||||
async def write_and_save_emails(self):
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
print("Sending emails to all leads.")
|
||||
print("Writing and saving emails for all leads.")
|
||||
|
||||
# Determine the top 3 candidates to proceed with
|
||||
top_candidate_ids = {
|
||||
@@ -141,7 +141,7 @@ class EmailAutoResponderFlow(Flow[LeadScoreState]):
|
||||
print("output_dir:", output_dir)
|
||||
output_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
async def send_email(candidate):
|
||||
async def write_email(candidate):
|
||||
# Check if the candidate is among the top 3
|
||||
proceed_with_candidate = candidate.id in top_candidate_ids
|
||||
|
||||
@@ -174,14 +174,14 @@ class EmailAutoResponderFlow(Flow[LeadScoreState]):
|
||||
|
||||
# Create tasks for all candidates
|
||||
for candidate in self.state.hydrated_candidates:
|
||||
task = asyncio.create_task(send_email(candidate))
|
||||
task = asyncio.create_task(write_email(candidate))
|
||||
tasks.append(task)
|
||||
|
||||
# Run all email-sending tasks concurrently and collect results
|
||||
# Run all email-writing tasks concurrently and collect results
|
||||
email_results = await asyncio.gather(*tasks)
|
||||
|
||||
# After all emails have been generated and saved
|
||||
print("\nAll emails have been generated and saved to 'email_responses' folder.")
|
||||
print("\nAll emails have been written and saved to 'email_responses' folder.")
|
||||
for message in email_results:
|
||||
print(message)
|
||||
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
Important Steps:
|
||||
# Meeting Assistant Flow
|
||||
|
||||
- https://trello.com/power-ups/admin/new
|
||||
- https://trello.com/power-ups/66eb355beb628bd3f2f44958/edit/api-key
|
||||
- https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/#revoking-tokens
|
||||
Welcome to the Meeting Assistant Flow project, powered by [crewAI](https://crewai.com). This example demonstrates how you can leverage Flows from crewAI to automate the process of managing meetings, including scheduling, note-taking, and follow-up actions. By utilizing Flows, the process becomes much simpler and more efficient.
|
||||
|
||||
# {{crew_name}} Crew
|
||||
## Overview
|
||||
|
||||
Welcome to the {{crew_name}} Crew project, powered by [crewAI](https://crewai.com). This template is designed to help you set up a multi-agent AI system with ease, leveraging the powerful and flexible framework provided by crewAI. Our goal is to enable your agents to collaborate effectively on complex tasks, maximizing their collective intelligence and capabilities.
|
||||
This flow will guide you through the process of setting up an automated meeting assistant. Here's a brief overview of what will happen in this flow:
|
||||
|
||||
1. **Load Meeting Notes**: The flow starts by loading the meeting notes from a file named `meeting_notes.txt`.
|
||||
|
||||
2. **Generate Tasks from Meeting Transcript**: The `MeetingAssistantCrew` is kicked off to generate tasks from the meeting transcript.
|
||||
|
||||
3. **Add Tasks to Trello**: The generated tasks are added to a Trello board.
|
||||
|
||||
4. **Save New Tasks to CSV**: The new tasks are saved to a CSV file named `new_tasks.csv`.
|
||||
|
||||
5. **Send Slack Notification**: A Slack notification is sent to a specified channel, informing about the new tasks added to Trello.
|
||||
|
||||
By following this flow, you can efficiently automate the process of managing meetings, leveraging the power of multiple AI agents to handle different aspects of the meeting workflow.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -26,14 +36,76 @@ Next, navigate to your project directory and install the dependencies:
|
||||
crewai install
|
||||
```
|
||||
|
||||
### Customizing
|
||||
### Customizing & Dependencies
|
||||
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `SERPER_API_KEY` into the `.env` file**
|
||||
**Add your `TRELLO_API_KEY`, `TRELLO_TOKEN`, `TRELLO_BOARD_ID`, and `TRELLO_LIST_ID` into the `.env` file**
|
||||
**Add your `SLACK_TOKEN` and `SLACK_CHANNEL_ID` into the `.env` file**
|
||||
|
||||
- Modify `src/write_a_book_with_flows/config/agents.yaml` to define your agents
|
||||
- Modify `src/write_a_book_with_flows/config/tasks.yaml` to define your tasks
|
||||
- Modify `src/write_a_book_with_flows/crew.py` to add your own logic, tools and specific args
|
||||
- Modify `src/write_a_book_with_flows/main.py` to add custom inputs for your agents and tasks
|
||||
To customize the behavior of the meeting assistant flow, you can update the agents and tasks defined in the `MeetingSchedulerCrew`, `NoteTakingCrew`, and `FollowUpCrew`. If you want to adjust the flow itself, you will need to modify the flow in `main.py`.
|
||||
|
||||
- **Agents and Tasks**: Modify `src/meeting_assistant_flow/config/agents.yaml` to define your agents and `src/meeting_assistant_flow/config/tasks.yaml` to define your tasks. This is where you can customize how meetings are scheduled, notes are taken, and follow-up actions are managed.
|
||||
|
||||
- **Flow Adjustments**: Modify `src/meeting_assistant_flow/main.py` to adjust the flow. This is where you can change how the flow orchestrates the different crews and tasks.
|
||||
|
||||
### Setting Up Trello
|
||||
|
||||
To enable the meeting assistant flow to interact with Trello, follow these steps to set up your Trello API credentials:
|
||||
|
||||
1. **Generate Trello API Key**:
|
||||
|
||||
- Visit the [Trello API Key page](https://trello.com/power-ups/admin/new) and log in with your Trello account.
|
||||
- Click on the "Create a Power-Up" button.
|
||||
- Fill in the required details for your Power-Up and click "Create".
|
||||
- Once created, you will see your API key. Copy this key and add it to your `.env` file as `TRELLO_API_KEY`.
|
||||
|
||||
2. **Generate Trello Token**:
|
||||
|
||||
- Visit the [Trello Power Up page](https://developer.atlassian.com/cloud/trello/) to learn how to create a Power-Up and generate your token.
|
||||
- Scroll down to the "OAuth" section and click on the "Token" link.
|
||||
- Authorize the application to access your Trello account.
|
||||
- You will be provided with a token. Copy this token and add it to your `.env` file as `TRELLO_TOKEN`.
|
||||
|
||||
3. **Find Trello Board ID**:
|
||||
|
||||
- Open Trello and navigate to the board you want to use.
|
||||
- The board ID is part of the URL. For example, in `https://trello.com/b/BOARD_ID/board-name`, `BOARD_ID` is your board ID.
|
||||
- Copy this ID and add it to your `.env` file as `TRELLO_BOARD_ID`.
|
||||
|
||||
4. **Find Trello List ID**:
|
||||
|
||||
- On your Trello board, click on the list where you want to add tasks.
|
||||
- Click on the three dots (menu) on the top right of the list and select "Copy Link".
|
||||
- The list ID is part of the URL. For example, in `https://trello.com/c/BOARD_ID/LIST_ID/card-name`, `LIST_ID` is your list ID.
|
||||
- Copy this ID and add it to your `.env` file as `TRELLO_LIST_ID`.
|
||||
|
||||
5. **Set Up Environment Variables**:
|
||||
- Add the following variables to your `.env` file:
|
||||
```plaintext
|
||||
TRELLO_API_KEY=your_trello_api_key
|
||||
TRELLO_TOKEN=your_trello_token
|
||||
TRELLO_BOARD_ID=your_trello_board_id
|
||||
TRELLO_LIST_ID=your_trello_list_id
|
||||
```
|
||||
|
||||
By following these steps, you will have set up your Trello API credentials correctly, allowing the meeting assistant flow to interact with your Trello board and lists.
|
||||
|
||||
### Setting Up Slack
|
||||
|
||||
To enable the meeting assistant flow to send notifications to Slack, follow these steps to set up your Slack API credentials:
|
||||
|
||||
1. **Create a Slack App**: Visit the [Slack API page](https://api.slack.com/apps) and create a new app.
|
||||
|
||||
2. **Generate Slack Token**: Under the "OAuth & Permissions" section, generate a token with the necessary permissions.
|
||||
|
||||
3. **Find Slack Channel ID**: To find your Slack channel ID, open Slack, go to the channel, and click on the channel name. The channel ID will be in the URL.
|
||||
|
||||
4. **Invite Slack Bot to Channel**: Invite the Slack bot to the channel by typing `/invite @your-bot-name` in the channel.
|
||||
|
||||
5. **Set Up Environment Variables**: Add the following variables to your `.env` file:
|
||||
- `SLACK_TOKEN`
|
||||
- `SLACK_CHANNEL_ID`
|
||||
|
||||
## Running the Project
|
||||
|
||||
@@ -43,17 +115,31 @@ To kickstart your crew of AI agents and begin task execution, run this from the
|
||||
crewai run
|
||||
```
|
||||
|
||||
This command initializes the write_a_book_with_flows Crew, assembling the agents and assigning them tasks as defined in your configuration.
|
||||
This command initializes the meeting_assistant_flow, assembling the agents and assigning them tasks as defined in your configuration.
|
||||
|
||||
This example, unmodified, will run the create a `report.md` file with the output of a research on LLMs in the root folder.
|
||||
When you kickstart the flow, it will orchestrate multiple crews to perform the tasks. The flow will first load meeting notes, then generate tasks from the transcript, add tasks to Trello, save tasks to a CSV file, and send a Slack notification.
|
||||
|
||||
## Understanding Your Crew
|
||||
## Understanding Your Flow
|
||||
|
||||
The write_a_book_with_flows Crew is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your crew.
|
||||
The meeting_assistant_flow is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your flow.
|
||||
|
||||
### Flow Structure
|
||||
|
||||
1. **Load Meeting Notes**: This step loads the meeting notes from a file named `meeting_notes.txt`.
|
||||
|
||||
2. **Generate Tasks from Meeting Transcript**: The `MeetingAssistantCrew` is kicked off to generate tasks from the meeting transcript.
|
||||
|
||||
3. **Add Tasks to Trello**: The generated tasks are added to a Trello board.
|
||||
|
||||
4. **Save New Tasks to CSV**: The new tasks are saved to a CSV file named `new_tasks.csv`.
|
||||
|
||||
5. **Send Slack Notification**: A Slack notification is sent to a specified channel, informing about the new tasks added to Trello.
|
||||
|
||||
By understanding the flow structure, you can see how multiple crews are orchestrated to work together, each handling a specific part of the meeting management process. This modular approach allows for efficient and scalable meeting automation.
|
||||
|
||||
## Support
|
||||
|
||||
For support, questions, or feedback regarding the {{crew_name}} Crew or crewAI.
|
||||
For support, questions, or feedback regarding the Meeting Assistant Flow or crewAI:
|
||||
|
||||
- Visit our [documentation](https://docs.crewai.com)
|
||||
- Reach out to us through our [GitHub repository](https://github.com/joaomdmoura/crewai)
|
||||
|
||||
@@ -32,15 +32,16 @@ Next, navigate to your project directory and install the dependencies:
|
||||
crewai install
|
||||
```
|
||||
|
||||
### Customizing
|
||||
### Customizing & Dependencies
|
||||
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `OPENAI_API_KEY` into the `.env` file**
|
||||
**Add your `SERPER_API_KEY` into the `.env` file**
|
||||
|
||||
- Modify `src/write_a_book_with_flows/config/agents.yaml` to define your agents
|
||||
- Modify `src/write_a_book_with_flows/config/tasks.yaml` to define your tasks
|
||||
- Modify `src/write_a_book_with_flows/crew.py` to add your own logic, tools and specific args
|
||||
- Modify `src/write_a_book_with_flows/main.py` to add custom inputs for your agents and tasks
|
||||
To customize the behavior of the book writing flow, you can update the agents and tasks defined in the `OutlineCrew` and `WriteBookChapterCrew`. If you want to adjust the flow itself, you will need to modify the flow in `main.py`.
|
||||
|
||||
- **Agents and Tasks**: Modify `src/write_a_book_with_flows/config/agents.yaml` to define your agents and `src/write_a_book_with_flows/config/tasks.yaml` to define your tasks. This is where you can customize how the book outline is generated and how chapters are written.
|
||||
|
||||
- **Flow Adjustments**: Modify `src/write_a_book_with_flows/main.py` to adjust the flow. This is where you can change how the flow orchestrates the different crews and tasks.
|
||||
|
||||
## Running the Project
|
||||
|
||||
@@ -54,7 +55,7 @@ This command initializes the write_a_book_with_flows Crew, assembling the agents
|
||||
|
||||
When you kickstart the flow, it will orchestrate multiple crews to perform the tasks. The flow will first generate a book outline, then create and run a crew for each chapter, and finally join all the chapters into a single markdown file.
|
||||
|
||||
## Understanding Your Crew
|
||||
## Understanding Your Flow
|
||||
|
||||
The write_a_book_with_flows Flow is composed of multiple AI agents, each with unique roles, goals, and tools. These agents collaborate on a series of tasks, defined in `config/tasks.yaml`, leveraging their collective skills to achieve complex objectives. The `config/agents.yaml` file outlines the capabilities and configurations of each agent in your flow.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user