Fozan-Talat commited on
Commit
edf6d57
1 Parent(s): 8b30572

Initial commit

Browse files
Multi-Agent BRD Generator/__pycache__/utils.cpython-311.pyc ADDED
Binary file (1.87 kB). View file
 
Multi-Agent BRD Generator/agentic-brd-gen.py ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ import warnings
4
+ warnings.filterwarnings('ignore')
5
+
6
+ from crewai import Agent, Task, Crew
7
+ from crewai_tools import (
8
+ #DirectoryReadTool,
9
+ #FileReadTool,
10
+ #SerperDevTool,
11
+ #WebsiteSearchTool,
12
+ #DOCXSearchTool,
13
+ #RagTool,
14
+ TXTSearchTool
15
+ )
16
+ from datetime import datetime
17
+
18
+
19
+ import os
20
+ from utils import get_openai_api_key
21
+
22
+
23
+ openai_api_key = get_openai_api_key()
24
+
25
+ os.environ["OPENAI_MODEL_NAME"] = 'gpt-3.5-turbo'
26
+ os.environ["OPENAI_API_KEY"] = "sk-proj-8nKBOgxInYCIqidcdSu7T3BlbkFJWac8qZbpFOE2TSn0OpId"
27
+
28
+
29
+ def call_crew_kickoff(str_current_datetime):
30
+ # Instantiate tools
31
+ #meeting_trans_docs_tool = DirectoryReadTool(directory='./meeting-transcription')
32
+ #brd_temp_docs_tool = DirectoryReadTool(directory='./brd-template')
33
+ #file_tool = FileReadTool()
34
+ #web_rag_tool = WebsiteSearchTool()
35
+ #docx_search_tool = DOCXSearchTool()
36
+ #rag_tool = RagTool()
37
+ mt_tool = TXTSearchTool(txt='./meeting-transcription/meeting-transcript_' + str_current_datetime + '.txt')
38
+ brd_tool = TXTSearchTool(txt='./brd-template/brd-template.txt')
39
+
40
+ text_parsing_agent = Agent(
41
+ role="Text Interpreter",
42
+ goal="Parse and interpret the raw text input, structuring it into manageable sections"
43
+ "or data points that are relevant for analysis and processing.",
44
+ backstory="You excel at deciphering complex textual data. You act as the first line of analysis,"
45
+ "turning unstructured text into organized segments. You should enhance efficiency in data"
46
+ "handling and support subsequent stages of data processing.",
47
+ tools=[mt_tool],
48
+ allow_delegation=True,
49
+ verbose=True
50
+ )
51
+
52
+ data_extraction_agent = Agent(
53
+ role="Data Extraction Agent",
54
+ goal="Identify and extract essential data points, statistics,"
55
+ "and specific information from the parsed text that are crucial"
56
+ "for drafting a Business Requirements Document.",
57
+ backstory="You should tackle the challenge of sifting through detailed textual data to"
58
+ "find relevant information. You should be doing it with precision and speed, equipped"
59
+ "with capabilities to recognize and categorize data efficiently, making it invaluable"
60
+ "for projects requiring quick turnaround and accurate data handling.",
61
+ tools=[mt_tool, brd_tool],
62
+ allow_delegation=True,
63
+ verbose=True
64
+ )
65
+
66
+ brd_compiler_agent = Agent(
67
+ role="BRD Compiler",
68
+ goal="Assemble the extracted data into a well-structured Business Requirements Document,"
69
+ "ensuring that it is clear, coherent, and formatted according to standards.",
70
+ backstory="You are a meticulous Business Requirement Document compiler, You should alleviate"
71
+ "the burdens of manual document assembly. Ensure that all documents are crafted with"
72
+ "precision, adhering to organizational standards, and ready for stakeholder review. You"
73
+ "should be automating routine documentation tasks, thus allowing human team members to focus"
74
+ "on more strategic activities.",
75
+ tools=[brd_tool],
76
+ allow_delegation=True,
77
+ verbose=True
78
+ )
79
+
80
+ text_parsing = Task(
81
+ description=(
82
+ "1. Open and read the contents of the input text file.\n"
83
+ "2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\n"
84
+ "3. Extract text under each identified section, ensuring context is preserved.\n"
85
+ "4. Format the extracted text into a JSON structure with labels indicating the type"
86
+ "of content (e.g., heading, detail)."
87
+ ),
88
+ expected_output="Structured JSON object containing separated sections of"
89
+ "text with labels based on their content type.",
90
+ agent=text_parsing_agent,
91
+ )
92
+
93
+ data_extraction = Task(
94
+ description=(
95
+ "1. Take the JSON structured data from the Text Parsing Agent.\n"
96
+ "2. Identify and extract specific data points like project goals, technical requirements,"
97
+ "and stakeholder information.\n"
98
+ "3. Organize the extracted data into relevant categories for easy access and use.\n"
99
+ "4. Format all extracted data into a structured form suitable for document generation,"
100
+ "ensuring it's ready for template insertion.\n"
101
+ ),
102
+ expected_output="A comprehensive list of key data points organized by category, ready for use in document generation.",
103
+ agent=data_extraction_agent,
104
+ )
105
+
106
+ compile_brd = Task(
107
+ description=(
108
+ "1. Accept the structured and categorized data from the Data Extraction Agent.\n"
109
+ "2. Open and read the BRD template for data insertion.\n"
110
+ "3. Insert the received data into the respective sections of the BRD template.\n"
111
+ "4. Apply formatting rules to ensure the document is professional and adheres to standards.\n"
112
+ "5. Save the populated and formatted document as a new markdown file, marking the task as complete.\n"
113
+ ),
114
+ expected_output="A complete Business Requirements Document in markdown format, ready for review and distribution.",
115
+ agent=brd_compiler_agent,
116
+ output_file='generated-brd/brd_' + str_current_datetime + '.md', # The final blog post will be saved here
117
+ )
118
+
119
+ crew = Crew(
120
+ agents=[text_parsing_agent, data_extraction_agent, brd_compiler_agent],
121
+ tasks=[text_parsing, data_extraction, compile_brd],
122
+ verbose=2
123
+ )
124
+
125
+ result = crew.kickoff(inputs={'datetime': str_current_datetime})
126
+
127
+
128
+ import gradio as gr
129
+
130
+ def process_file(input_file):
131
+ current_datetime = datetime.now().strftime("%Y-%m-%d %H-%M-%S")
132
+ print("Current date & time : ", current_datetime)
133
+
134
+ # convert datetime obj to string
135
+ str_current_datetime = str(current_datetime)
136
+
137
+ fh = open(input_file, 'rb')
138
+ #data = fh.read()
139
+
140
+ # Ensure the target directory exists
141
+ output_dir = "meeting-transcription"
142
+ if not os.path.exists(output_dir):
143
+ os.makedirs(output_dir)
144
+
145
+ # Save the uploaded file to the specified folder with the specified name
146
+ input_filepath = os.path.join(output_dir, "meeting-transcript_" + str_current_datetime + ".txt")
147
+ with open(input_filepath, "wb") as file:
148
+ file.write(fh.read())
149
+ fh.close()
150
+
151
+ call_crew_kickoff(str_current_datetime)
152
+
153
+ # Example of processing: adding Markdown formatting. Replace this with your actual processing.
154
+ #processed_text = "# Processed Output\n\n" + "\n".join(f"- {line}" for line in text.splitlines())
155
+
156
+ output_filename = "generated-brd/brd_" + str_current_datetime + ".md"
157
+ #with open(output_filename, "w") as file:
158
+ # file.write(processed_text)
159
+
160
+ # Read the contents of the generated Markdown file
161
+ with open(output_filename, "r") as md_file:
162
+ markdown_content = md_file.read()
163
+
164
+ # Return both the filename for download and the Markdown content for display
165
+ return output_filename, markdown_content
166
+
167
+ with gr.Blocks() as demo:
168
+ with gr.Row():
169
+ file_input = gr.File(label="Upload a text file")
170
+ download_btn = gr.File(label="Download Processed File in Markdown", file_count="single")
171
+ with gr.Row():
172
+ markdown_output = gr.Markdown()
173
+
174
+ file_input.change(process_file, inputs=file_input, outputs=[download_btn, markdown_output])
175
+
176
+ demo.launch(share=True)
177
+
178
+
179
+
Multi-Agent BRD Generator/brd-template-docx/Business Requirements Document (BRD) Template.docx ADDED
Binary file (14.8 kB). View file
 
Multi-Agent BRD Generator/brd-template/brd-template.txt ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Business Requirements Document (BRD)
2
+ 1. Document Information
3
+ • Document Title:
4
+ • Date:
5
+ • Author:
6
+ • Version:
7
+ 2. Executive Summary
8
+ 2.1. Purpose
9
+ Briefly describe the purpose of the POC and the document.
10
+ 2.2. Project Background
11
+ Provide a brief context for the POC, including the business problem it aims to address.
12
+ 2.3. Scope
13
+ Outline what the POC will cover and what it will not cover.
14
+ 3. Business Objectives
15
+ 3.1. Goals
16
+ List the main goals of the POC.
17
+ 3.2. Success Criteria
18
+ Define the criteria for determining the success of the POC.
19
+ 4. Stakeholders
20
+ 4.1. Stakeholder List
21
+ List key stakeholders involved in the POC.
22
+ Name Role Contact Information
23
+
24
+
25
+ 5. Requirements
26
+ 5.1. Functional Requirements
27
+ List the critical functional requirements.
28
+ Requirement ID Description Priority Acceptance Criteria
29
+
30
+
31
+ 5.2. Non-Functional Requirements
32
+ List key non-functional requirements, if any.
33
+ Requirement ID Description Priority Acceptance Criteria
34
+
35
+
36
+ 6. Assumptions and Constraints
37
+ 6.1. Assumptions
38
+ List assumptions made during the POC planning.
39
+ 6.2. Constraints
40
+ Describe any constraints, such as budget, time, or technology limitations.
41
+ 7. Risks and Mitigation
42
+ 7.1. Identified Risks
43
+ List potential risks and mitigation strategies.
44
+ Risk ID Description Impact Probability Mitigation Strategy
45
+
46
+ 8. Dependencies
47
+ 8.1. Dependencies
48
+ List any dependencies relevant to the POC.
49
+ 9. Glossary
50
+ Define key terms and acronyms used in the document.
51
+
Multi-Agent BRD Generator/db/a6ae2df1-a8e2-4f5f-9c2a-6c268ea4dbba/data_level0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f18abd8c514282db82706e52b0a33ed659cd534e925a6f149deb7af9ce34bd8e
3
+ size 6284000
Multi-Agent BRD Generator/db/a6ae2df1-a8e2-4f5f-9c2a-6c268ea4dbba/header.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:effaa959ce2b30070fdafc2fe82096fc46e4ee7561b75920dd3ce43d09679b21
3
+ size 100
Multi-Agent BRD Generator/db/a6ae2df1-a8e2-4f5f-9c2a-6c268ea4dbba/length.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:89962e38c26665b92825851fd530def7bcb299adbf1061967cb3c6ce3e88db21
3
+ size 4000
Multi-Agent BRD Generator/db/a6ae2df1-a8e2-4f5f-9c2a-6c268ea4dbba/link_lists.bin ADDED
File without changes
Multi-Agent BRD Generator/db/chroma.sqlite3 ADDED
Binary file (410 kB). View file
 
Multi-Agent BRD Generator/generated-brd/brd_2024-06-10 16-12-03.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Business Requirements Document
2
+
3
+ ## Document Information
4
+ - **Document Title:** Business Requirements Document
5
+ - **Date:** [Insert Date]
6
+ - **Author:** [Insert Author Name]
7
+ - **Version:** [Insert Version Number]
8
+
9
+ ## Executive Summary
10
+ ### 2.1 Purpose
11
+ Briefly describe the purpose of the POC and the document.
12
+
13
+ ### 2.2 Project Background
14
+ Provide a brief context for the POC, including the business problem it aims to address.
15
+
16
+ ### 2.3 Scope
17
+ Outline what the POC will cover and what it will not cover.
18
+
19
+ ## Business Objectives
20
+ ### 3.1 Goals
21
+ 1. Detailed discussions with stakeholder groups for gathering requirements.
22
+ 2. Expanding success criteria to include user acceptance testing results.
23
+ 3. Addressing time constraints and technical debt issues.
24
+ 4. Mitigating risks like data breaches and project delays.
25
+ 5. Upgrading database architecture, developing analytics functionalities, and enhancing user interface.
26
+ 6. Ensuring clear communication among project teams and stakeholders.
27
+ 7. Ongoing monitoring during development for strict quality assurance.
28
+
29
+ ### 3.2 Success Criteria
30
+ Define the criteria for determining the success of the POC.
31
+
32
+ ## Stakeholders
33
+ ### 4.1 Stakeholder List
34
+ 1. Taylor Brown (Stakeholder Representative)
35
+ 2. Sam Lee (Business Analyst)
36
+ 3. Chris Smith (Quality Assurance Manager)
37
+ 4. Jessica Davis (Technical Lead)
38
+ 5. Alex Johnson (Project Manager)
39
+
40
+ ## Requirements
41
+ ### 5.1 Functional Requirements
42
+ 1. Robust backend support for the IT team.
43
+ 2. Advanced analytics features for the marketing team.
44
+ 3. Resource allocation and potential staffing considerations.
45
+ 4. Implementation of stringent security measures.
46
+ 5. Agile project management techniques.
47
+ 6. Combined automated and manual testing for quality assurance.
48
+
49
+ ### 5.2 Non-Functional Requirements
50
+ 1. Detailed cost-benefit analysis post-implementation.
51
+ 2. Modular capabilities for future expansions.
52
+
53
+ ## Assumptions and Constraints
54
+ ### 6.1 Assumptions
55
+ - List assumptions made during the POC planning.
56
+
57
+ ### 6.2 Constraints
58
+ - Describe any constraints, such as budget, time, or technology limitations.
59
+
60
+ ## Risks and Mitigation
61
+ ### 7.1 Identified Risks
62
+ 1. Data breaches
63
+ 2. Project delays
64
+ 3. Lack of user acceptance
65
+ 4. Technical debt
66
+
67
+ ## Dependencies
68
+ ### 8.1 Dependencies
69
+ - List any dependencies relevant to the POC.
70
+
71
+ ## Glossary
72
+ - Define key terms and acronyms used in the document.
73
+
74
+ ---
75
+
76
+ ### Additional Comments:
77
+ - **Jessica Davis (Technical Lead):** Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.
78
+ - **Taylor Brown (Stakeholder Representative):** Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.
79
+ - **Alex Johnson (Project Manager):** With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today�s discussion. Let�s aim to have that ready by next week�s meeting.
Multi-Agent BRD Generator/meeting-transcription-docx/Meeting Transcript - Extensive IT Project Requirements Discussion.docx ADDED
Binary file (14.1 kB). View file
 
Multi-Agent BRD Generator/meeting-transcription/meeting-transcript.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Meeting Transcript: Extensive IT Project Requirements Discussion
2
+
3
+ Date: June 7, 2024
4
+ Time: 9:00 AM to 12:00 PM
5
+ Location: Conference Room B
6
+ Attendees:
7
+
8
+ Alex Johnson (Project Manager)
9
+ Sam Lee (Business Analyst)
10
+ Jessica Davis (Technical Lead)
11
+ Chris Smith (Quality Assurance Manager)
12
+ Taylor Brown (Stakeholder Representative)
13
+
14
+ Meeting Summary:
15
+ Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.
16
+
17
+ Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.
18
+
19
+ Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.
20
+
21
+ Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.
22
+
23
+ Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.
24
+
25
+ Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.
26
+
27
+ Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.
28
+
29
+ Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.
30
+
31
+ Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.
32
+
33
+ Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.
34
+
35
+ Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.
36
+
37
+ Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.
38
+
39
+ Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.
40
+
41
+ Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.
42
+
43
+ Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.
44
+
45
+ Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.
46
+
47
+ Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.
Multi-Agent BRD Generator/meeting-transcription/meeting-transcript_2024-06-10 16-08-59.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Meeting Transcript: Extensive IT Project Requirements Discussion
2
+
3
+ Date: June 7, 2024
4
+ Time: 9:00 AM to 12:00 PM
5
+ Location: Conference Room B
6
+ Attendees:
7
+
8
+ Alex Johnson (Project Manager)
9
+ Sam Lee (Business Analyst)
10
+ Jessica Davis (Technical Lead)
11
+ Chris Smith (Quality Assurance Manager)
12
+ Taylor Brown (Stakeholder Representative)
13
+
14
+ Meeting Summary:
15
+ Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.
16
+
17
+ Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.
18
+
19
+ Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.
20
+
21
+ Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.
22
+
23
+ Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.
24
+
25
+ Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.
26
+
27
+ Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.
28
+
29
+ Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.
30
+
31
+ Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.
32
+
33
+ Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.
34
+
35
+ Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.
36
+
37
+ Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.
38
+
39
+ Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.
40
+
41
+ Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.
42
+
43
+ Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.
44
+
45
+ Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.
46
+
47
+ Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.
Multi-Agent BRD Generator/meeting-transcription/meeting-transcript_2024-06-10 16-12-03.txt ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Meeting Transcript: Extensive IT Project Requirements Discussion
2
+
3
+ Date: June 7, 2024
4
+ Time: 9:00 AM to 12:00 PM
5
+ Location: Conference Room B
6
+ Attendees:
7
+
8
+ Alex Johnson (Project Manager)
9
+ Sam Lee (Business Analyst)
10
+ Jessica Davis (Technical Lead)
11
+ Chris Smith (Quality Assurance Manager)
12
+ Taylor Brown (Stakeholder Representative)
13
+
14
+ Meeting Summary:
15
+ Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.
16
+
17
+ Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.
18
+
19
+ Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.
20
+
21
+ Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.
22
+
23
+ Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.
24
+
25
+ Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.
26
+
27
+ Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.
28
+
29
+ Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.
30
+
31
+ Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.
32
+
33
+ Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.
34
+
35
+ Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.
36
+
37
+ Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.
38
+
39
+ Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.
40
+
41
+ Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.
42
+
43
+ Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.
44
+
45
+ Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.
46
+
47
+ Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.
Multi-Agent BRD Generator/requirements.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ crewai==0.28.8
2
+ crewai_tools==0.1.6
3
+ langchain_community==0.0.29
4
+ huggingface_hub
5
+ gradio
Multi-Agent BRD Generator/script-gradio.ipynb ADDED
@@ -0,0 +1,1089 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "You can download the `requirements.txt` for this course from the workspace of this lab. `File --> Open...`"
8
+ ]
9
+ },
10
+ {
11
+ "cell_type": "markdown",
12
+ "metadata": {},
13
+ "source": [
14
+ "# L2: Create Agents to Research and Write an Article\n",
15
+ "\n",
16
+ "In this lesson, you will be introduced to the foundational concepts of multi-agent systems and get an overview of the crewAI framework."
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "markdown",
21
+ "metadata": {},
22
+ "source": [
23
+ "The libraries are already installed in the classroom. If you're running this notebook on your own machine, you can install the following:\n",
24
+ "```Python\n",
25
+ "!pip install crewai==0.28.8 crewai_tools==0.1.6 langchain_community==0.0.29\n",
26
+ "```"
27
+ ]
28
+ },
29
+ {
30
+ "cell_type": "code",
31
+ "execution_count": 1,
32
+ "metadata": {
33
+ "height": 64
34
+ },
35
+ "outputs": [],
36
+ "source": [
37
+ "# Warning control\n",
38
+ "import warnings\n",
39
+ "warnings.filterwarnings('ignore')"
40
+ ]
41
+ },
42
+ {
43
+ "cell_type": "markdown",
44
+ "metadata": {},
45
+ "source": [
46
+ "- Import from the crewAI libray."
47
+ ]
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "execution_count": 2,
52
+ "metadata": {
53
+ "height": 166
54
+ },
55
+ "outputs": [],
56
+ "source": [
57
+ "from crewai import Agent, Task, Crew\n",
58
+ "from crewai_tools import (\n",
59
+ " #DirectoryReadTool,\n",
60
+ " #FileReadTool,\n",
61
+ " #SerperDevTool,\n",
62
+ " #WebsiteSearchTool,\n",
63
+ " #DOCXSearchTool,\n",
64
+ " #RagTool,\n",
65
+ " TXTSearchTool\n",
66
+ ")\n",
67
+ "from datetime import datetime"
68
+ ]
69
+ },
70
+ {
71
+ "cell_type": "markdown",
72
+ "metadata": {},
73
+ "source": [
74
+ "- As a LLM for your agents, you'll be using OpenAI's `gpt-3.5-turbo`.\n",
75
+ "\n",
76
+ "**Optional Note:** crewAI also allow other popular models to be used as a LLM for your Agents. You can see some of the examples at the [bottom of the notebook](#1)."
77
+ ]
78
+ },
79
+ {
80
+ "cell_type": "code",
81
+ "execution_count": 3,
82
+ "metadata": {
83
+ "height": 149
84
+ },
85
+ "outputs": [],
86
+ "source": [
87
+ "import os\n",
88
+ "from utils import get_openai_api_key\n",
89
+ "\n",
90
+ "# Set up API keys\n",
91
+ "\n",
92
+ "openai_api_key = get_openai_api_key()\n",
93
+ "\n",
94
+ "os.environ[\"OPENAI_MODEL_NAME\"] = 'gpt-3.5-turbo'\n",
95
+ "os.environ[\"OPENAI_API_KEY\"] = \"sk-proj-8nKBOgxInYCIqidcdSu7T3BlbkFJWac8qZbpFOE2TSn0OpId\"\n"
96
+ ]
97
+ },
98
+ {
99
+ "cell_type": "code",
100
+ "execution_count": 4,
101
+ "metadata": {
102
+ "height": 132
103
+ },
104
+ "outputs": [],
105
+ "source": [
106
+ "def call_crew_kickoff(str_current_datetime):\n",
107
+ " # Instantiate tools\n",
108
+ " #meeting_trans_docs_tool = DirectoryReadTool(directory='./meeting-transcription')\n",
109
+ " #brd_temp_docs_tool = DirectoryReadTool(directory='./brd-template')\n",
110
+ " #file_tool = FileReadTool()\n",
111
+ " #web_rag_tool = WebsiteSearchTool()\n",
112
+ " #docx_search_tool = DOCXSearchTool()\n",
113
+ " #rag_tool = RagTool()\n",
114
+ " mt_tool = TXTSearchTool(txt='./meeting-transcription/meeting-transcript_' + str_current_datetime + '.txt')\n",
115
+ " brd_tool = TXTSearchTool(txt='./brd-template/brd-template.txt')\n",
116
+ "\n",
117
+ " text_parsing_agent = Agent(\n",
118
+ " role=\"Text Interpreter\",\n",
119
+ " goal=\"Parse and interpret the raw text input, structuring it into manageable sections\"\n",
120
+ " \"or data points that are relevant for analysis and processing.\",\n",
121
+ " backstory=\"You excel at deciphering complex textual data. You act as the first line of analysis,\"\n",
122
+ " \"turning unstructured text into organized segments. You should enhance efficiency in data\"\n",
123
+ " \"handling and support subsequent stages of data processing.\",\n",
124
+ " tools=[mt_tool],\n",
125
+ " allow_delegation=True,\n",
126
+ " verbose=True\n",
127
+ " )\n",
128
+ "\n",
129
+ " data_extraction_agent = Agent(\n",
130
+ " role=\"Data Extraction Agent\",\n",
131
+ " goal=\"Identify and extract essential data points, statistics,\"\n",
132
+ " \"and specific information from the parsed text that are crucial\"\n",
133
+ " \"for drafting a Business Requirements Document.\",\n",
134
+ " backstory=\"You should tackle the challenge of sifting through detailed textual data to\"\n",
135
+ " \"find relevant information. You should be doing it with precision and speed, equipped\"\n",
136
+ " \"with capabilities to recognize and categorize data efficiently, making it invaluable\"\n",
137
+ " \"for projects requiring quick turnaround and accurate data handling.\",\n",
138
+ " tools=[mt_tool, brd_tool],\n",
139
+ " allow_delegation=True,\n",
140
+ " verbose=True\n",
141
+ " )\n",
142
+ "\n",
143
+ " brd_compiler_agent = Agent(\n",
144
+ " role=\"BRD Compiler\",\n",
145
+ " goal=\"Assemble the extracted data into a well-structured Business Requirements Document,\"\n",
146
+ " \"ensuring that it is clear, coherent, and formatted according to standards.\",\n",
147
+ " backstory=\"You are a meticulous Business Requirement Document compiler, You should alleviate\"\n",
148
+ " \"the burdens of manual document assembly. Ensure that all documents are crafted with\"\n",
149
+ " \"precision, adhering to organizational standards, and ready for stakeholder review. You\"\n",
150
+ " \"should be automating routine documentation tasks, thus allowing human team members to focus\"\n",
151
+ " \"on more strategic activities.\",\n",
152
+ " tools=[brd_tool],\n",
153
+ " allow_delegation=True,\n",
154
+ " verbose=True\n",
155
+ " )\n",
156
+ "\n",
157
+ " text_parsing = Task(\n",
158
+ " description=(\n",
159
+ " \"1. Open and read the contents of the input text file.\\n\"\n",
160
+ " \"2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\\n\"\n",
161
+ " \"3. Extract text under each identified section, ensuring context is preserved.\\n\"\n",
162
+ " \"4. Format the extracted text into a JSON structure with labels indicating the type\"\n",
163
+ " \"of content (e.g., heading, detail).\"\n",
164
+ " ),\n",
165
+ " expected_output=\"Structured JSON object containing separated sections of\"\n",
166
+ " \"text with labels based on their content type.\",\n",
167
+ " agent=text_parsing_agent,\n",
168
+ " )\n",
169
+ "\n",
170
+ " data_extraction = Task(\n",
171
+ " description=(\n",
172
+ " \"1. Take the JSON structured data from the Text Parsing Agent.\\n\"\n",
173
+ " \"2. Identify and extract specific data points like project goals, technical requirements,\"\n",
174
+ " \"and stakeholder information.\\n\"\n",
175
+ " \"3. Organize the extracted data into relevant categories for easy access and use.\\n\"\n",
176
+ " \"4. Format all extracted data into a structured form suitable for document generation,\"\n",
177
+ " \"ensuring it's ready for template insertion.\\n\"\n",
178
+ " ),\n",
179
+ " expected_output=\"A comprehensive list of key data points organized by category, ready for use in document generation.\",\n",
180
+ " agent=data_extraction_agent,\n",
181
+ " )\n",
182
+ "\n",
183
+ " compile_brd = Task(\n",
184
+ " description=(\n",
185
+ " \"1. Accept the structured and categorized data from the Data Extraction Agent.\\n\"\n",
186
+ " \"2. Open and read the BRD template for data insertion.\\n\"\n",
187
+ " \"3. Insert the received data into the respective sections of the BRD template.\\n\"\n",
188
+ " \"4. Apply formatting rules to ensure the document is professional and adheres to standards.\\n\"\n",
189
+ " \"5. Save the populated and formatted document as a new markdown file, marking the task as complete.\\n\"\n",
190
+ " ),\n",
191
+ " expected_output=\"A complete Business Requirements Document in markdown format, ready for review and distribution.\",\n",
192
+ " agent=brd_compiler_agent,\n",
193
+ " output_file='generated-brd/brd_' + str_current_datetime + '.md', # The final blog post will be saved here\n",
194
+ " )\n",
195
+ "\n",
196
+ " crew = Crew(\n",
197
+ " agents=[text_parsing_agent, data_extraction_agent, brd_compiler_agent],\n",
198
+ " tasks=[text_parsing, data_extraction, compile_brd],\n",
199
+ " verbose=2\n",
200
+ " )\n",
201
+ "\n",
202
+ " result = crew.kickoff(inputs={'datetime': str_current_datetime})\n",
203
+ "\n",
204
+ " from IPython.display import Markdown\n",
205
+ " Markdown(result)"
206
+ ]
207
+ },
208
+ {
209
+ "cell_type": "markdown",
210
+ "metadata": {},
211
+ "source": [
212
+ "## Creating Agents\n",
213
+ "\n",
214
+ "- Define your Agents, and provide them a `role`, `goal` and `backstory`.\n",
215
+ "- It has been seen that LLMs perform better when they are role playing."
216
+ ]
217
+ },
218
+ {
219
+ "cell_type": "markdown",
220
+ "metadata": {},
221
+ "source": [
222
+ "### Agent: Planner\n",
223
+ "\n",
224
+ "**Note**: The benefit of using _multiple strings_ :\n",
225
+ "```Python\n",
226
+ "varname = \"line 1 of text\"\n",
227
+ " \"line 2 of text\"\n",
228
+ "```\n",
229
+ "\n",
230
+ "versus the _triple quote docstring_:\n",
231
+ "```Python\n",
232
+ "varname = \"\"\"line 1 of text\n",
233
+ " line 2 of text\n",
234
+ " \"\"\"\n",
235
+ "```\n",
236
+ "is that it can avoid adding those whitespaces and newline characters, making it better formatted to be passed to the LLM."
237
+ ]
238
+ },
239
+ {
240
+ "cell_type": "markdown",
241
+ "metadata": {},
242
+ "source": [
243
+ "### Agent: Writer"
244
+ ]
245
+ },
246
+ {
247
+ "cell_type": "code",
248
+ "execution_count": null,
249
+ "metadata": {
250
+ "height": 217
251
+ },
252
+ "outputs": [],
253
+ "source": [
254
+ " "
255
+ ]
256
+ },
257
+ {
258
+ "cell_type": "markdown",
259
+ "metadata": {},
260
+ "source": [
261
+ "### Agent: Editor"
262
+ ]
263
+ },
264
+ {
265
+ "cell_type": "code",
266
+ "execution_count": null,
267
+ "metadata": {
268
+ "height": 251
269
+ },
270
+ "outputs": [],
271
+ "source": [
272
+ " "
273
+ ]
274
+ },
275
+ {
276
+ "cell_type": "markdown",
277
+ "metadata": {},
278
+ "source": [
279
+ "## Creating Tasks\n",
280
+ "\n",
281
+ "- Define your Tasks, and provide them a `description`, `expected_output` and `agent`."
282
+ ]
283
+ },
284
+ {
285
+ "cell_type": "markdown",
286
+ "metadata": {},
287
+ "source": [
288
+ "### Task: Plan"
289
+ ]
290
+ },
291
+ {
292
+ "cell_type": "code",
293
+ "execution_count": null,
294
+ "metadata": {
295
+ "height": 217
296
+ },
297
+ "outputs": [],
298
+ "source": [
299
+ " "
300
+ ]
301
+ },
302
+ {
303
+ "cell_type": "markdown",
304
+ "metadata": {},
305
+ "source": [
306
+ "### Task: Write"
307
+ ]
308
+ },
309
+ {
310
+ "cell_type": "code",
311
+ "execution_count": 5,
312
+ "metadata": {
313
+ "height": 234
314
+ },
315
+ "outputs": [
316
+ {
317
+ "data": {
318
+ "text/plain": [
319
+ "' data_extraction = Task(\\n description=(\\n \"1. Take the JSON structured data from the Text Parsing Agent.\\n\"\\n \"2. Identify and extract specific data points like project goals, technical requirements,\"\\n \"and stakeholder information.\\n\"\\n \"3. Organize the extracted data into relevant categories for easy access and use.\\n\"\\n \"4. Format all extracted data into a structured form suitable for document generation,\"\\n \"ensuring it\\'s ready for template insertion.\\n\"\\n ),\\n expected_output=\"A comprehensive list of key data points organized by category, ready for use in document generation.\",\\n agent=data_extraction_agent,\\n )\\n'"
320
+ ]
321
+ },
322
+ "execution_count": 5,
323
+ "metadata": {},
324
+ "output_type": "execute_result"
325
+ }
326
+ ],
327
+ "source": [
328
+ "''' data_extraction = Task(\n",
329
+ " description=(\n",
330
+ " \"1. Take the JSON structured data from the Text Parsing Agent.\\n\"\n",
331
+ " \"2. Identify and extract specific data points like project goals, technical requirements,\"\n",
332
+ " \"and stakeholder information.\\n\"\n",
333
+ " \"3. Organize the extracted data into relevant categories for easy access and use.\\n\"\n",
334
+ " \"4. Format all extracted data into a structured form suitable for document generation,\"\n",
335
+ " \"ensuring it's ready for template insertion.\\n\"\n",
336
+ " ),\n",
337
+ " expected_output=\"A comprehensive list of key data points organized by category, ready for use in document generation.\",\n",
338
+ " agent=data_extraction_agent,\n",
339
+ " )\n",
340
+ "'''"
341
+ ]
342
+ },
343
+ {
344
+ "cell_type": "markdown",
345
+ "metadata": {},
346
+ "source": [
347
+ "### Task: Edit"
348
+ ]
349
+ },
350
+ {
351
+ "cell_type": "code",
352
+ "execution_count": 6,
353
+ "metadata": {
354
+ "height": 200
355
+ },
356
+ "outputs": [
357
+ {
358
+ "data": {
359
+ "text/plain": [
360
+ "' compile_brd = Task(\\n description=(\\n \"1. Accept the structured and categorized data from the Data Extraction Agent.\\n\"\\n \"2. Open and read the BRD template for data insertion.\\n\"\\n \"3. Insert the received data into the respective sections of the BRD template.\\n\"\\n \"4. Apply formatting rules to ensure the document is professional and adheres to standards.\\n\"\\n \"5. Save the populated and formatted document as a new markdown file, marking the task as complete.\\n\"\\n ),\\n expected_output=\"A complete Business Requirements Document in markdown format, ready for review and distribution.\",\\n agent=brd_compiler_agent,\\n output_file=\\'generated-brd/brd_{datetime}.md\\', # The final blog post will be saved here\\n )\\n'"
361
+ ]
362
+ },
363
+ "execution_count": 6,
364
+ "metadata": {},
365
+ "output_type": "execute_result"
366
+ }
367
+ ],
368
+ "source": [
369
+ "''' compile_brd = Task(\n",
370
+ " description=(\n",
371
+ " \"1. Accept the structured and categorized data from the Data Extraction Agent.\\n\"\n",
372
+ " \"2. Open and read the BRD template for data insertion.\\n\"\n",
373
+ " \"3. Insert the received data into the respective sections of the BRD template.\\n\"\n",
374
+ " \"4. Apply formatting rules to ensure the document is professional and adheres to standards.\\n\"\n",
375
+ " \"5. Save the populated and formatted document as a new markdown file, marking the task as complete.\\n\"\n",
376
+ " ),\n",
377
+ " expected_output=\"A complete Business Requirements Document in markdown format, ready for review and distribution.\",\n",
378
+ " agent=brd_compiler_agent,\n",
379
+ " output_file='generated-brd/brd_{datetime}.md', # The final blog post will be saved here\n",
380
+ " )\n",
381
+ "'''"
382
+ ]
383
+ },
384
+ {
385
+ "cell_type": "markdown",
386
+ "metadata": {},
387
+ "source": [
388
+ "## Creating the Crew\n",
389
+ "\n",
390
+ "- Create your crew of Agents\n",
391
+ "- Pass the tasks to be performed by those agents.\n",
392
+ " - **Note**: *For this simple example*, the tasks will be performed sequentially (i.e they are dependent on each other), so the _order_ of the task in the list _matters_.\n",
393
+ "- `verbose=2` allows you to see all the logs of the execution. "
394
+ ]
395
+ },
396
+ {
397
+ "cell_type": "code",
398
+ "execution_count": 7,
399
+ "metadata": {
400
+ "height": 98
401
+ },
402
+ "outputs": [
403
+ {
404
+ "data": {
405
+ "text/plain": [
406
+ "' crew = Crew(\\n agents=[text_parsing_agent, data_extraction_agent, brd_compiler_agent],\\n tasks=[text_parsing, data_extraction, compile_brd],\\n verbose=2\\n )\\n'"
407
+ ]
408
+ },
409
+ "execution_count": 7,
410
+ "metadata": {},
411
+ "output_type": "execute_result"
412
+ }
413
+ ],
414
+ "source": [
415
+ "''' crew = Crew(\n",
416
+ " agents=[text_parsing_agent, data_extraction_agent, brd_compiler_agent],\n",
417
+ " tasks=[text_parsing, data_extraction, compile_brd],\n",
418
+ " verbose=2\n",
419
+ " )\n",
420
+ "'''"
421
+ ]
422
+ },
423
+ {
424
+ "cell_type": "markdown",
425
+ "metadata": {},
426
+ "source": [
427
+ "## Running the Crew"
428
+ ]
429
+ },
430
+ {
431
+ "cell_type": "markdown",
432
+ "metadata": {},
433
+ "source": [
434
+ "**Note**: LLMs can provide different outputs for they same input, so what you get might be different than what you see in the video."
435
+ ]
436
+ },
437
+ {
438
+ "cell_type": "code",
439
+ "execution_count": 8,
440
+ "metadata": {
441
+ "height": 30
442
+ },
443
+ "outputs": [
444
+ {
445
+ "data": {
446
+ "text/plain": [
447
+ "\"\\n result = crew.kickoff(inputs={'datetime': str_current_datetime})\\n\\n from IPython.display import Markdown\\n Markdown(result)\\n\""
448
+ ]
449
+ },
450
+ "execution_count": 8,
451
+ "metadata": {},
452
+ "output_type": "execute_result"
453
+ }
454
+ ],
455
+ "source": [
456
+ "'''\n",
457
+ " result = crew.kickoff(inputs={'datetime': str_current_datetime})\n",
458
+ "\n",
459
+ " from IPython.display import Markdown\n",
460
+ " Markdown(result)\n",
461
+ "'''"
462
+ ]
463
+ },
464
+ {
465
+ "cell_type": "markdown",
466
+ "metadata": {},
467
+ "source": [
468
+ "- Display the results of your execution as markdown in the notebook."
469
+ ]
470
+ },
471
+ {
472
+ "cell_type": "code",
473
+ "execution_count": null,
474
+ "metadata": {
475
+ "height": 47
476
+ },
477
+ "outputs": [],
478
+ "source": []
479
+ },
480
+ {
481
+ "cell_type": "code",
482
+ "execution_count": 9,
483
+ "metadata": {
484
+ "height": 30
485
+ },
486
+ "outputs": [
487
+ {
488
+ "name": "stdout",
489
+ "output_type": "stream",
490
+ "text": [
491
+ "Python 3.11.9\n"
492
+ ]
493
+ }
494
+ ],
495
+ "source": [
496
+ "!python --version"
497
+ ]
498
+ },
499
+ {
500
+ "cell_type": "code",
501
+ "execution_count": 10,
502
+ "metadata": {},
503
+ "outputs": [],
504
+ "source": [
505
+ "import gradio as gr"
506
+ ]
507
+ },
508
+ {
509
+ "cell_type": "code",
510
+ "execution_count": 11,
511
+ "metadata": {},
512
+ "outputs": [],
513
+ "source": [
514
+ "def process_file(input_file):\n",
515
+ " current_datetime = datetime.now().strftime(\"%Y-%m-%d %H-%M-%S\")\n",
516
+ " print(\"Current date & time : \", current_datetime)\n",
517
+ " \n",
518
+ " # convert datetime obj to string\n",
519
+ " str_current_datetime = str(current_datetime)\n",
520
+ "\n",
521
+ " fh = open(input_file, 'rb')\n",
522
+ " #data = fh.read()\n",
523
+ "\n",
524
+ " # Ensure the target directory exists\n",
525
+ " output_dir = \"meeting-transcription\"\n",
526
+ " if not os.path.exists(output_dir):\n",
527
+ " os.makedirs(output_dir)\n",
528
+ " \n",
529
+ " # Save the uploaded file to the specified folder with the specified name\n",
530
+ " input_filepath = os.path.join(output_dir, \"meeting-transcript_\" + str_current_datetime + \".txt\")\n",
531
+ " with open(input_filepath, \"wb\") as file:\n",
532
+ " file.write(fh.read())\n",
533
+ " fh.close()\n",
534
+ "\n",
535
+ " call_crew_kickoff(str_current_datetime)\n",
536
+ "\n",
537
+ " # Example of processing: adding Markdown formatting. Replace this with your actual processing.\n",
538
+ " #processed_text = \"# Processed Output\\n\\n\" + \"\\n\".join(f\"- {line}\" for line in text.splitlines())\n",
539
+ " \n",
540
+ " output_filename = \"generated-brd/brd_\" + str_current_datetime + \".md\"\n",
541
+ " #with open(output_filename, \"w\") as file:\n",
542
+ " # file.write(processed_text)\n",
543
+ "\n",
544
+ " # Read the contents of the generated Markdown file\n",
545
+ " with open(output_filename, \"r\") as md_file:\n",
546
+ " markdown_content = md_file.read()\n",
547
+ "\n",
548
+ " # Return both the filename for download and the Markdown content for display\n",
549
+ " return output_filename, markdown_content"
550
+ ]
551
+ },
552
+ {
553
+ "cell_type": "code",
554
+ "execution_count": 12,
555
+ "metadata": {},
556
+ "outputs": [
557
+ {
558
+ "name": "stdout",
559
+ "output_type": "stream",
560
+ "text": [
561
+ "Running on local URL: http://127.0.0.1:7860\n",
562
+ "Running on public URL: https://555181993525c76e6c.gradio.live\n",
563
+ "\n",
564
+ "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"
565
+ ]
566
+ },
567
+ {
568
+ "data": {
569
+ "text/html": [
570
+ "<div><iframe src=\"https://555181993525c76e6c.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
571
+ ],
572
+ "text/plain": [
573
+ "<IPython.core.display.HTML object>"
574
+ ]
575
+ },
576
+ "metadata": {},
577
+ "output_type": "display_data"
578
+ },
579
+ {
580
+ "data": {
581
+ "text/plain": []
582
+ },
583
+ "execution_count": 12,
584
+ "metadata": {},
585
+ "output_type": "execute_result"
586
+ },
587
+ {
588
+ "name": "stdout",
589
+ "output_type": "stream",
590
+ "text": [
591
+ "Current date & time : 2024-06-09 17-53-45\n"
592
+ ]
593
+ },
594
+ {
595
+ "name": "stderr",
596
+ "output_type": "stream",
597
+ "text": [
598
+ "Inserting batches in chromadb: 100%|██████████| 1/1 [00:00<00:00, 1.40it/s]\n"
599
+ ]
600
+ },
601
+ {
602
+ "name": "stdout",
603
+ "output_type": "stream",
604
+ "text": [
605
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: Text Interpreter\u001b[00m\n",
606
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Open and read the contents of the input text file.\n",
607
+ "2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\n",
608
+ "3. Extract text under each identified section, ensuring context is preserved.\n",
609
+ "4. Format the extracted text into a JSON structure with labels indicating the typeof content (e.g., heading, detail).\u001b[00m\n",
610
+ "\n",
611
+ "\n",
612
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
613
+ "\u001b[32;1m\u001b[1;3mI need to start by searching the content of the input text file to understand its structure and identify headings, subheadings, and key paragraphs.\n",
614
+ "\n",
615
+ "Action:\n",
616
+ "Search a txt's content\n",
617
+ "\n",
618
+ "Action Input:\n",
619
+ "{\n",
620
+ "\"search_query\": \"meeting-transcription/meeting-transcript_2024-06-09 17-53-45.txt\"\n",
621
+ "}\n",
622
+ "\u001b[0m\u001b[95m \n",
623
+ "\n",
624
+ "Relevant Content:\n",
625
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
626
+ " \n",
627
+ "Date: June 7, 2024\n",
628
+ "Time: 9:00 AM to 12:00 PM\n",
629
+ "Location: Conference Room B\n",
630
+ "Attendees:\n",
631
+ " \n",
632
+ "Alex Johnson (Project Manager)\n",
633
+ "Sam Lee (Business Analyst)\n",
634
+ "Jessica Davis (Technical Lead) \n",
635
+ "Chris Smith (Quality Assurance Manager)\n",
636
+ "Taylor Brown (Stakeholder Representative)\n",
637
+ "\n",
638
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
639
+ " \n",
640
+ "Date: June 7, 2024\n",
641
+ "Time: 9:00 AM to 12:00 PM\n",
642
+ "Location: Conference Room B\n",
643
+ "Attendees:\n",
644
+ " \n",
645
+ "Alex Johnson (Project Manager)\n",
646
+ "Sam Lee (Business Analyst)\n",
647
+ "Jessica Davis (Technical Lead) \n",
648
+ "Chris Smith (Quality Assurance Manager)\n",
649
+ "Taylor Brown (Stakeholder Representative)\n",
650
+ "\n",
651
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
652
+ " \n",
653
+ "Date: June 7, 2024\n",
654
+ "Time: 9:00 AM to 12:00 PM\n",
655
+ "Location: Conference Room B\n",
656
+ "Attendees:\n",
657
+ " \n",
658
+ "Alex Johnson (Project Manager)\n",
659
+ "Sam Lee (Business Analyst)\n",
660
+ "Jessica Davis (Technical Lead) \n",
661
+ "Chris Smith (Quality Assurance Manager)\n",
662
+ "Taylor Brown (Stakeholder Representative)\n",
663
+ "\u001b[00m\n",
664
+ "\u001b[32;1m\u001b[1;3mFinal Answer: \n",
665
+ "{\n",
666
+ " \"Meeting Transcript\": [\n",
667
+ " {\n",
668
+ " \"Date\": \"June 7, 2024\",\n",
669
+ " \"Time\": \"9:00 AM to 12:00 PM\",\n",
670
+ " \"Location\": \"Conference Room B\",\n",
671
+ " \"Attendees\": [\n",
672
+ " \"Alex Johnson (Project Manager)\",\n",
673
+ " \"Sam Lee (Business Analyst)\",\n",
674
+ " \"Jessica Davis (Technical Lead)\",\n",
675
+ " \"Chris Smith (Quality Assurance Manager)\",\n",
676
+ " \"Taylor Brown (Stakeholder Representative)\"\n",
677
+ " ]\n",
678
+ " }\n",
679
+ " ]\n",
680
+ "}\u001b[0m\n",
681
+ "\n",
682
+ "\u001b[1m> Finished chain.\u001b[0m\n",
683
+ "\u001b[1m\u001b[92m [DEBUG]: == [Text Interpreter] Task output: {\n",
684
+ " \"Meeting Transcript\": [\n",
685
+ " {\n",
686
+ " \"Date\": \"June 7, 2024\",\n",
687
+ " \"Time\": \"9:00 AM to 12:00 PM\",\n",
688
+ " \"Location\": \"Conference Room B\",\n",
689
+ " \"Attendees\": [\n",
690
+ " \"Alex Johnson (Project Manager)\",\n",
691
+ " \"Sam Lee (Business Analyst)\",\n",
692
+ " \"Jessica Davis (Technical Lead)\",\n",
693
+ " \"Chris Smith (Quality Assurance Manager)\",\n",
694
+ " \"Taylor Brown (Stakeholder Representative)\"\n",
695
+ " ]\n",
696
+ " }\n",
697
+ " ]\n",
698
+ "}\n",
699
+ "\n",
700
+ "\u001b[00m\n",
701
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: Data Extraction Agent\u001b[00m\n",
702
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Take the JSON structured data from the Text Parsing Agent.\n",
703
+ "2. Identify and extract specific data points like project goals, technical requirements,and stakeholder information.\n",
704
+ "3. Organize the extracted data into relevant categories for easy access and use.\n",
705
+ "4. Format all extracted data into a structured form suitable for document generation,ensuring it's ready for template insertion.\n",
706
+ "\u001b[00m\n",
707
+ "\n",
708
+ "\n",
709
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
710
+ "\u001b[32;1m\u001b[1;3mI need to extract specific data points related to project goals, technical requirements, and stakeholder information from the meeting transcript provided.\n",
711
+ "\n",
712
+ "Action: Search a txt's content\n",
713
+ "Action Input: {'search_query': 'project goals'}\u001b[0m\u001b[95m \n",
714
+ "\n",
715
+ "Relevant Content:\n",
716
+ "Meeting Summary:\n",
717
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
718
+ " \n",
719
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
720
+ " \n",
721
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
722
+ " \n",
723
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
724
+ " \n",
725
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
726
+ " \n",
727
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
728
+ " \n",
729
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
730
+ "\n",
731
+ "Meeting Summary:\n",
732
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
733
+ " \n",
734
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
735
+ " \n",
736
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
737
+ " \n",
738
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
739
+ " \n",
740
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
741
+ " \n",
742
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
743
+ " \n",
744
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
745
+ "\n",
746
+ "Meeting Summary:\n",
747
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
748
+ " \n",
749
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
750
+ " \n",
751
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
752
+ " \n",
753
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
754
+ " \n",
755
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
756
+ " \n",
757
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
758
+ " \n",
759
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
760
+ "\u001b[00m\n",
761
+ "\u001b[32;1m\u001b[1;3mFinal Answer:\n",
762
+ "Project Goals:\n",
763
+ "1. Integrate advanced analytics into the platform to enhance user experience and provide robust data insights.\n",
764
+ "2. Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
765
+ "3. Realize a return on investment within one year post-implementation by increasing revenue through data-driven marketing strategies and reducing operational costs.\n",
766
+ "\n",
767
+ "Technical Requirements:\n",
768
+ "1. Substantial updates to data processing infrastructure.\n",
769
+ "2. Possible migration of services to a more scalable cloud solution.\n",
770
+ "3. Compliance with data protection regulations.\n",
771
+ "4. Future-proofing the system for further upgrades.\n",
772
+ "\n",
773
+ "Stakeholder Information:\n",
774
+ "1. Internal stakeholders: IT and customer service teams.\n",
775
+ "2. External stakeholders: Technology partners and end-users.\n",
776
+ "3. Understanding their interests and influence on the project is crucial.\u001b[0m\n",
777
+ "\n",
778
+ "\u001b[1m> Finished chain.\u001b[0m\n",
779
+ "\u001b[1m\u001b[92m [DEBUG]: == [Data Extraction Agent] Task output: Project Goals:\n",
780
+ "1. Integrate advanced analytics into the platform to enhance user experience and provide robust data insights.\n",
781
+ "2. Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
782
+ "3. Realize a return on investment within one year post-implementation by increasing revenue through data-driven marketing strategies and reducing operational costs.\n",
783
+ "\n",
784
+ "Technical Requirements:\n",
785
+ "1. Substantial updates to data processing infrastructure.\n",
786
+ "2. Possible migration of services to a more scalable cloud solution.\n",
787
+ "3. Compliance with data protection regulations.\n",
788
+ "4. Future-proofing the system for further upgrades.\n",
789
+ "\n",
790
+ "Stakeholder Information:\n",
791
+ "1. Internal stakeholders: IT and customer service teams.\n",
792
+ "2. External stakeholders: Technology partners and end-users.\n",
793
+ "3. Understanding their interests and influence on the project is crucial.\n",
794
+ "\n",
795
+ "\u001b[00m\n",
796
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: BRD Compiler\u001b[00m\n",
797
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Accept the structured and categorized data from the Data Extraction Agent.\n",
798
+ "2. Open and read the BRD template for data insertion.\n",
799
+ "3. Insert the received data into the respective sections of the BRD template.\n",
800
+ "4. Apply formatting rules to ensure the document is professional and adheres to standards.\n",
801
+ "5. Save the populated and formatted document as a new markdown file, marking the task as complete.\n",
802
+ "\u001b[00m\n",
803
+ "\n",
804
+ "\n",
805
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
806
+ "\u001b[32;1m\u001b[1;3mI need to efficiently compile the structured and categorized data from the Data Extraction Agent into a well-organized Business Requirements Document that aligns with the project goals, technical requirements, and stakeholder information.\n",
807
+ "\n",
808
+ "Action:\n",
809
+ "Delegate work to co-worker\n",
810
+ "Action Input:\n",
811
+ "{\n",
812
+ " \"task\": \"Extract structured and categorized data\",\n",
813
+ " \"context\": \"I need the Data Extraction Agent to provide me with the structured and categorized data for the Business Requirements Document.\"\n",
814
+ "}\n",
815
+ "\u001b[0m\u001b[91m \n",
816
+ "\n",
817
+ "I encountered an error while trying to use the tool. This was the error: 'NoneType' object has no attribute 'startswith'.\n",
818
+ " Tool Delegate work to co-worker accepts these inputs: Delegate work to co-worker(task: str, context: str, coworker: Optional[str] = None, **kwargs) - Delegate a specific task to one of the following co-workers: [Text Interpreter, Data Extraction Agent]\n",
819
+ "The input to this tool should be the co-worker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.\n",
820
+ "\u001b[00m\n",
821
+ "\u001b[32;1m\u001b[1;3mThought: I need to efficiently compile the structured and categorized data from the Data Extraction Agent into a well-organized Business Requirements Document that aligns with the project goals, technical requirements, and stakeholder information.\n",
822
+ "\n",
823
+ "Action: Search a txt's content\n",
824
+ "Action Input: {\"search_query\": \"BRD Template\"}\u001b[0m\u001b[95m \n",
825
+ "\n",
826
+ "Relevant Content:\n",
827
+ "Business Requirements Document (BRD)\n",
828
+ "1. Document Information\n",
829
+ "•\tDocument Title:\n",
830
+ "•\tDate:\n",
831
+ "•\tAuthor:\n",
832
+ "•\tVersion:\n",
833
+ "2. Executive Summary\n",
834
+ "2.1. Purpose\n",
835
+ "Briefly describe the purpose of the POC and the document.\n",
836
+ "2.2. Project Background\n",
837
+ "Provide a brief context for the POC, including the business problem it aims to address.\n",
838
+ "2.3. Scope\n",
839
+ "Outline what the POC will cover and what it will not cover.\n",
840
+ "3. Business Objectives\n",
841
+ "3.1. Goals\n",
842
+ "List the main goals of the POC.\n",
843
+ "3.2. Success Criteria\n",
844
+ "Define the criteria for determining the success of the POC.\n",
845
+ "4. Stakeholders\n",
846
+ "4.1. Stakeholder List\n",
847
+ "List key stakeholders involved in the POC.\n",
848
+ "Name\tRole\tContact Information\n",
849
+ "\t\t\n",
850
+ "\t\t\n",
851
+ "5. Requirements\n",
852
+ "5.1. Functional Requirements\n",
853
+ "List the critical functional requirements.\n",
854
+ "Requirement ID\tDescription\tPriority\tAcceptance Criteria\n",
855
+ "\t\t\t\n",
856
+ "\t\t\t\n",
857
+ "5.2. Non-Functional Requirements\n",
858
+ "List key non-functional requirements, if any.\n",
859
+ "Requirement ID\tDescription\tPriority\tAcceptance Criteria\n",
860
+ "\t\t\t\n",
861
+ "\t\t\t\n",
862
+ "6. Assumptions and Constraints\n",
863
+ "6.1. Assumptions\n",
864
+ "List assumptions made during the POC planning.\n",
865
+ "6.2. Constraints\n",
866
+ "Describe any constraints, such as budget, time, or technology limitations.\n",
867
+ "7. Risks and Mitigation\n",
868
+ "7.1. Identified Risks\n",
869
+ "List potential risks and mitigation strategies.\n",
870
+ "Risk ID\tDescription\tImpact\tProbability\tMitigation Strategy\n",
871
+ "\t\t\t\t\n",
872
+ "8. Dependencies\n",
873
+ "8.1. Dependencies\n",
874
+ "List any dependencies relevant to the POC.\n",
875
+ "9. Glossary\n",
876
+ "Define key terms and acronyms used in the document.\n",
877
+ "\n",
878
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
879
+ " \n",
880
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
881
+ " \n",
882
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
883
+ "\n",
884
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
885
+ " \n",
886
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
887
+ " \n",
888
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
889
+ "\u001b[00m\n",
890
+ "\u001b[32;1m\u001b[1;3mFinal Answer:\n",
891
+ "\n",
892
+ "# Business Requirements Document (BRD)\n",
893
+ "\n",
894
+ "## Document Information\n",
895
+ "- Document Title: Business Requirements Document for Advanced Analytics Integration\n",
896
+ "- Date: [Current Date]\n",
897
+ "- Author: [Your Name]\n",
898
+ "- Version: 1.0\n",
899
+ "\n",
900
+ "## Executive Summary\n",
901
+ "### 2.1. Purpose\n",
902
+ "The purpose of this document is to outline the business requirements for integrating advanced analytics into the platform to enhance user experience and provide robust data insights.\n",
903
+ "\n",
904
+ "### 2.2. Project Background\n",
905
+ "The project aims to address the business problem of improving customer engagement and satisfaction by increasing daily active users and reducing customer complaints through data-driven marketing strategies.\n",
906
+ "\n",
907
+ "### 2.3. Scope\n",
908
+ "The scope of this project includes substantial updates to data processing infrastructure, possible migration to a scalable cloud solution, compliance with data protection regulations, and future-proofing the system for further upgrades.\n",
909
+ "\n",
910
+ "## Business Objectives\n",
911
+ "### 3.1. Goals\n",
912
+ "- Integrate advanced analytics to enhance user experience.\n",
913
+ "- Increase daily active users and reduce customer complaints.\n",
914
+ "- Realize a return on investment within one year post-implementation.\n",
915
+ "\n",
916
+ "### 3.2. Success Criteria\n",
917
+ "- Increased user engagement metrics.\n",
918
+ "- Reduced customer complaints by x%.\n",
919
+ "- Revenue increase through data-driven marketing strategies.\n",
920
+ "- Operational cost reduction by x%.\n",
921
+ "\n",
922
+ "## Stakeholders\n",
923
+ "### 4.1. Stakeholder List\n",
924
+ "| Name | Role | Contact Information |\n",
925
+ "|-----------------|-----------------------|---------------------|\n",
926
+ "| Internal Stakeholders | IT and customer service teams | - |\n",
927
+ "| External Stakeholders | Technology partners and end-users | - |\n",
928
+ "\n",
929
+ "## Requirements\n",
930
+ "### 5.1. Functional Requirements\n",
931
+ "| Requirement ID | Description | Priority | Acceptance Criteria |\n",
932
+ "|----------------|-------------|----------|----------------------|\n",
933
+ "\n",
934
+ "### 5.2. Non-Functional Requirements\n",
935
+ "| Requirement ID | Description | Priority | Acceptance Criteria |\n",
936
+ "|----------------|-------------|----------|----------------------|\n",
937
+ "\n",
938
+ "## Assumptions and Constraints\n",
939
+ "### 6.1. Assumptions\n",
940
+ "- [List of assumptions made during planning]\n",
941
+ "\n",
942
+ "### 6.2. Constraints\n",
943
+ "- [Description of any constraints such as budget, time, or technology limitations]\n",
944
+ "\n",
945
+ "## Risks and Mitigation\n",
946
+ "### 7.1. Identified Risks\n",
947
+ "| Risk ID | Description | Impact | Probability | Mitigation Strategy |\n",
948
+ "|---------|-------------|--------|-------------|----------------------|\n",
949
+ "\n",
950
+ "## Dependencies\n",
951
+ "### 8.1. Dependencies\n",
952
+ "- [List of dependencies relevant to the project]\n",
953
+ "\n",
954
+ "## Glossary\n",
955
+ "- [Define key terms and acronyms used in the document]\n",
956
+ "\n",
957
+ "---\n",
958
+ "\n",
959
+ "**Technical Lead Input (Jessica Davis):**\n",
960
+ "Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
961
+ "\n",
962
+ "**Stakeholder Representative Input (Taylor Brown):**\n",
963
+ "Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
964
+ "\n",
965
+ "**Project Manager Input (Alex Johnson):**\n",
966
+ "With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\u001b[0m\n",
967
+ "\n",
968
+ "\u001b[1m> Finished chain.\u001b[0m\n",
969
+ "\u001b[1m\u001b[92m [DEBUG]: == [BRD Compiler] Task output: # Business Requirements Document (BRD)\n",
970
+ "\n",
971
+ "## Document Information\n",
972
+ "- Document Title: Business Requirements Document for Advanced Analytics Integration\n",
973
+ "- Date: [Current Date]\n",
974
+ "- Author: [Your Name]\n",
975
+ "- Version: 1.0\n",
976
+ "\n",
977
+ "## Executive Summary\n",
978
+ "### 2.1. Purpose\n",
979
+ "The purpose of this document is to outline the business requirements for integrating advanced analytics into the platform to enhance user experience and provide robust data insights.\n",
980
+ "\n",
981
+ "### 2.2. Project Background\n",
982
+ "The project aims to address the business problem of improving customer engagement and satisfaction by increasing daily active users and reducing customer complaints through data-driven marketing strategies.\n",
983
+ "\n",
984
+ "### 2.3. Scope\n",
985
+ "The scope of this project includes substantial updates to data processing infrastructure, possible migration to a scalable cloud solution, compliance with data protection regulations, and future-proofing the system for further upgrades.\n",
986
+ "\n",
987
+ "## Business Objectives\n",
988
+ "### 3.1. Goals\n",
989
+ "- Integrate advanced analytics to enhance user experience.\n",
990
+ "- Increase daily active users and reduce customer complaints.\n",
991
+ "- Realize a return on investment within one year post-implementation.\n",
992
+ "\n",
993
+ "### 3.2. Success Criteria\n",
994
+ "- Increased user engagement metrics.\n",
995
+ "- Reduced customer complaints by x%.\n",
996
+ "- Revenue increase through data-driven marketing strategies.\n",
997
+ "- Operational cost reduction by x%.\n",
998
+ "\n",
999
+ "## Stakeholders\n",
1000
+ "### 4.1. Stakeholder List\n",
1001
+ "| Name | Role | Contact Information |\n",
1002
+ "|-----------------|-----------------------|---------------------|\n",
1003
+ "| Internal Stakeholders | IT and customer service teams | - |\n",
1004
+ "| External Stakeholders | Technology partners and end-users | - |\n",
1005
+ "\n",
1006
+ "## Requirements\n",
1007
+ "### 5.1. Functional Requirements\n",
1008
+ "| Requirement ID | Description | Priority | Acceptance Criteria |\n",
1009
+ "|----------------|-------------|----------|----------------------|\n",
1010
+ "\n",
1011
+ "### 5.2. Non-Functional Requirements\n",
1012
+ "| Requirement ID | Description | Priority | Acceptance Criteria |\n",
1013
+ "|----------------|-------------|----------|----------------------|\n",
1014
+ "\n",
1015
+ "## Assumptions and Constraints\n",
1016
+ "### 6.1. Assumptions\n",
1017
+ "- [List of assumptions made during planning]\n",
1018
+ "\n",
1019
+ "### 6.2. Constraints\n",
1020
+ "- [Description of any constraints such as budget, time, or technology limitations]\n",
1021
+ "\n",
1022
+ "## Risks and Mitigation\n",
1023
+ "### 7.1. Identified Risks\n",
1024
+ "| Risk ID | Description | Impact | Probability | Mitigation Strategy |\n",
1025
+ "|---------|-------------|--------|-------------|----------------------|\n",
1026
+ "\n",
1027
+ "## Dependencies\n",
1028
+ "### 8.1. Dependencies\n",
1029
+ "- [List of dependencies relevant to the project]\n",
1030
+ "\n",
1031
+ "## Glossary\n",
1032
+ "- [Define key terms and acronyms used in the document]\n",
1033
+ "\n",
1034
+ "---\n",
1035
+ "\n",
1036
+ "**Technical Lead Input (Jessica Davis):**\n",
1037
+ "Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
1038
+ "\n",
1039
+ "**Stakeholder Representative Input (Taylor Brown):**\n",
1040
+ "Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
1041
+ "\n",
1042
+ "**Project Manager Input (Alex Johnson):**\n",
1043
+ "With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
1044
+ "\n",
1045
+ "\u001b[00m\n"
1046
+ ]
1047
+ }
1048
+ ],
1049
+ "source": [
1050
+ "\n",
1051
+ "with gr.Blocks() as demo:\n",
1052
+ " with gr.Row():\n",
1053
+ " file_input = gr.File(label=\"Upload a text file\")\n",
1054
+ " download_btn = gr.File(label=\"Download Processed File in Markdown\", file_count=\"single\")\n",
1055
+ " with gr.Row():\n",
1056
+ " markdown_output = gr.Markdown()\n",
1057
+ "\n",
1058
+ " file_input.change(process_file, inputs=file_input, outputs=[download_btn, markdown_output])\n",
1059
+ "\n",
1060
+ "demo.launch(share=True)\n"
1061
+ ]
1062
+ }
1063
+ ],
1064
+ "metadata": {
1065
+ "colab": {
1066
+ "gpuType": "T4",
1067
+ "provenance": []
1068
+ },
1069
+ "kernelspec": {
1070
+ "display_name": "Python 3 (ipykernel)",
1071
+ "language": "python",
1072
+ "name": "python3"
1073
+ },
1074
+ "language_info": {
1075
+ "codemirror_mode": {
1076
+ "name": "ipython",
1077
+ "version": 3
1078
+ },
1079
+ "file_extension": ".py",
1080
+ "mimetype": "text/x-python",
1081
+ "name": "python",
1082
+ "nbconvert_exporter": "python",
1083
+ "pygments_lexer": "ipython3",
1084
+ "version": "3.11.9"
1085
+ }
1086
+ },
1087
+ "nbformat": 4,
1088
+ "nbformat_minor": 4
1089
+ }
Multi-Agent BRD Generator/script-local.ipynb ADDED
@@ -0,0 +1,537 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "You can download the `requirements.txt` for this course from the workspace of this lab. `File --> Open...`"
8
+ ]
9
+ },
10
+ {
11
+ "cell_type": "markdown",
12
+ "metadata": {},
13
+ "source": [
14
+ "# L2: Create Agents to Research and Write an Article\n",
15
+ "\n",
16
+ "In this lesson, you will be introduced to the foundational concepts of multi-agent systems and get an overview of the crewAI framework."
17
+ ]
18
+ },
19
+ {
20
+ "cell_type": "markdown",
21
+ "metadata": {},
22
+ "source": [
23
+ "The libraries are already installed in the classroom. If you're running this notebook on your own machine, you can install the following:\n",
24
+ "```Python\n",
25
+ "!pip install crewai==0.28.8 crewai_tools==0.1.6 langchain_community==0.0.29\n",
26
+ "```"
27
+ ]
28
+ },
29
+ {
30
+ "cell_type": "code",
31
+ "execution_count": 1,
32
+ "metadata": {
33
+ "height": 64
34
+ },
35
+ "outputs": [],
36
+ "source": [
37
+ "# Warning control\n",
38
+ "import warnings\n",
39
+ "warnings.filterwarnings('ignore')"
40
+ ]
41
+ },
42
+ {
43
+ "cell_type": "markdown",
44
+ "metadata": {},
45
+ "source": [
46
+ "- Import from the crewAI libray."
47
+ ]
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "execution_count": 2,
52
+ "metadata": {
53
+ "height": 166
54
+ },
55
+ "outputs": [],
56
+ "source": [
57
+ "from crewai import Agent, Task, Crew\n",
58
+ "from crewai_tools import (\n",
59
+ " #DirectoryReadTool,\n",
60
+ " #FileReadTool,\n",
61
+ " #SerperDevTool,\n",
62
+ " #WebsiteSearchTool,\n",
63
+ " #DOCXSearchTool,\n",
64
+ " #RagTool,\n",
65
+ " TXTSearchTool\n",
66
+ ")"
67
+ ]
68
+ },
69
+ {
70
+ "cell_type": "markdown",
71
+ "metadata": {},
72
+ "source": [
73
+ "- As a LLM for your agents, you'll be using OpenAI's `gpt-3.5-turbo`.\n",
74
+ "\n",
75
+ "**Optional Note:** crewAI also allow other popular models to be used as a LLM for your Agents. You can see some of the examples at the [bottom of the notebook](#1)."
76
+ ]
77
+ },
78
+ {
79
+ "cell_type": "code",
80
+ "execution_count": 3,
81
+ "metadata": {
82
+ "height": 149
83
+ },
84
+ "outputs": [],
85
+ "source": [
86
+ "import os\n",
87
+ "from utils import get_openai_api_key\n",
88
+ "\n",
89
+ "# Set up API keys\n",
90
+ "\n",
91
+ "openai_api_key = get_openai_api_key()\n",
92
+ "\n",
93
+ "os.environ[\"OPENAI_MODEL_NAME\"] = 'gpt-3.5-turbo'\n",
94
+ "os.environ[\"OPENAI_API_KEY\"] = \"sk-proj-h6HzpeR29C5zZHqleyLMT3BlbkFJLJCKDOrG3ZzYHE03EQHH\"\n"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "code",
99
+ "execution_count": 4,
100
+ "metadata": {
101
+ "height": 132
102
+ },
103
+ "outputs": [
104
+ {
105
+ "name": "stderr",
106
+ "output_type": "stream",
107
+ "text": [
108
+ "Inserting batches in chromadb: 0%| | 0/1 [00:04<?, ?it/s]\n",
109
+ "Inserting batches in chromadb: 0%| | 0/1 [00:03<?, ?it/s]\n"
110
+ ]
111
+ }
112
+ ],
113
+ "source": [
114
+ "# Instantiate tools\n",
115
+ "#meeting_trans_docs_tool = DirectoryReadTool(directory='./meeting-transcription')\n",
116
+ "#brd_temp_docs_tool = DirectoryReadTool(directory='./brd-template')\n",
117
+ "#file_tool = FileReadTool()\n",
118
+ "#web_rag_tool = WebsiteSearchTool()\n",
119
+ "#docx_search_tool = DOCXSearchTool()\n",
120
+ "#rag_tool = RagTool()\n",
121
+ "mt_tool = TXTSearchTool(txt='./meeting-transcription/meeting-transcript.txt')\n",
122
+ "brd_tool = TXTSearchTool(txt='./brd-template/brd-template.txt')"
123
+ ]
124
+ },
125
+ {
126
+ "cell_type": "markdown",
127
+ "metadata": {},
128
+ "source": [
129
+ "## Creating Agents\n",
130
+ "\n",
131
+ "- Define your Agents, and provide them a `role`, `goal` and `backstory`.\n",
132
+ "- It has been seen that LLMs perform better when they are role playing."
133
+ ]
134
+ },
135
+ {
136
+ "cell_type": "markdown",
137
+ "metadata": {},
138
+ "source": [
139
+ "### Agent: Planner\n",
140
+ "\n",
141
+ "**Note**: The benefit of using _multiple strings_ :\n",
142
+ "```Python\n",
143
+ "varname = \"line 1 of text\"\n",
144
+ " \"line 2 of text\"\n",
145
+ "```\n",
146
+ "\n",
147
+ "versus the _triple quote docstring_:\n",
148
+ "```Python\n",
149
+ "varname = \"\"\"line 1 of text\n",
150
+ " line 2 of text\n",
151
+ " \"\"\"\n",
152
+ "```\n",
153
+ "is that it can avoid adding those whitespaces and newline characters, making it better formatted to be passed to the LLM."
154
+ ]
155
+ },
156
+ {
157
+ "cell_type": "code",
158
+ "execution_count": 5,
159
+ "metadata": {
160
+ "height": 200
161
+ },
162
+ "outputs": [],
163
+ "source": [
164
+ "text_parsing_agent = Agent(\n",
165
+ " role=\"Text Interpreter\",\n",
166
+ " goal=\"Parse and interpret the raw text input, structuring it into manageable sections\"\n",
167
+ " \"or data points that are relevant for analysis and processing.\",\n",
168
+ " backstory=\"You excel at deciphering complex textual data. You act as the first line of analysis,\"\n",
169
+ " \"turning unstructured text into organized segments. You should enhance efficiency in data\"\n",
170
+ " \"handling and support subsequent stages of data processing.\",\n",
171
+ " tools=[mt_tool],\n",
172
+ " allow_delegation=True,\n",
173
+ "\tverbose=True\n",
174
+ ")"
175
+ ]
176
+ },
177
+ {
178
+ "cell_type": "markdown",
179
+ "metadata": {},
180
+ "source": [
181
+ "### Agent: Writer"
182
+ ]
183
+ },
184
+ {
185
+ "cell_type": "code",
186
+ "execution_count": 6,
187
+ "metadata": {
188
+ "height": 217
189
+ },
190
+ "outputs": [],
191
+ "source": [
192
+ "data_extraction_agent = Agent(\n",
193
+ " role=\"Data Extraction Agent\",\n",
194
+ " goal=\"Identify and extract essential data points, statistics,\"\n",
195
+ " \"and specific information from the parsed text that are crucial\"\n",
196
+ " \"for drafting a Business Requirements Document.\",\n",
197
+ " backstory=\"You should tackle the challenge of sifting through detailed textual data to\"\n",
198
+ " \"find relevant information. You should be doing it with precision and speed, equipped\"\n",
199
+ " \"with capabilities to recognize and categorize data efficiently, making it invaluable\"\n",
200
+ " \"for projects requiring quick turnaround and accurate data handling.\",\n",
201
+ " tools=[mt_tool, brd_tool],\n",
202
+ " allow_delegation=True,\n",
203
+ " verbose=True\n",
204
+ ")"
205
+ ]
206
+ },
207
+ {
208
+ "cell_type": "markdown",
209
+ "metadata": {},
210
+ "source": [
211
+ "### Agent: Editor"
212
+ ]
213
+ },
214
+ {
215
+ "cell_type": "code",
216
+ "execution_count": 7,
217
+ "metadata": {
218
+ "height": 251
219
+ },
220
+ "outputs": [],
221
+ "source": [
222
+ "brd_compiler_agent = Agent(\n",
223
+ " role=\"BRD Compiler\",\n",
224
+ " goal=\"Assemble the extracted data into a well-structured Business Requirements Document,\"\n",
225
+ " \"ensuring that it is clear, coherent, and formatted according to standards.\",\n",
226
+ " backstory=\"You are a meticulous Business Requirement Document compiler, You should alleviate\"\n",
227
+ " \"the burdens of manual document assembly. Ensure that all documents are crafted with\"\n",
228
+ " \"precision, adhering to organizational standards, and ready for stakeholder review. You\"\n",
229
+ " \"should be automating routine documentation tasks, thus allowing human team members to focus\"\n",
230
+ " \"on more strategic activities.\",\n",
231
+ " tools=[brd_tool],\n",
232
+ " output_file='generated-brd/brd.md', # The final blog post will be saved here\n",
233
+ " allow_delegation=True,\n",
234
+ " verbose=True\n",
235
+ ")"
236
+ ]
237
+ },
238
+ {
239
+ "cell_type": "markdown",
240
+ "metadata": {},
241
+ "source": [
242
+ "## Creating Tasks\n",
243
+ "\n",
244
+ "- Define your Tasks, and provide them a `description`, `expected_output` and `agent`."
245
+ ]
246
+ },
247
+ {
248
+ "cell_type": "markdown",
249
+ "metadata": {},
250
+ "source": [
251
+ "### Task: Plan"
252
+ ]
253
+ },
254
+ {
255
+ "cell_type": "code",
256
+ "execution_count": 8,
257
+ "metadata": {
258
+ "height": 217
259
+ },
260
+ "outputs": [],
261
+ "source": [
262
+ "text_parsing = Task(\n",
263
+ " description=(\n",
264
+ " \"1. Open and read the contents of the input text file.\\n\"\n",
265
+ " \"2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\\n\"\n",
266
+ " \"3. Extract text under each identified section, ensuring context is preserved.\\n\"\n",
267
+ " \"4. Format the extracted text into a JSON structure with labels indicating the type\"\n",
268
+ " \"of content (e.g., heading, detail).\"\n",
269
+ " ),\n",
270
+ " expected_output=\"Structured JSON object containing separated sections of\"\n",
271
+ " \"text with labels based on their content type.\",\n",
272
+ " agent=text_parsing_agent,\n",
273
+ ")"
274
+ ]
275
+ },
276
+ {
277
+ "cell_type": "markdown",
278
+ "metadata": {},
279
+ "source": [
280
+ "### Task: Write"
281
+ ]
282
+ },
283
+ {
284
+ "cell_type": "code",
285
+ "execution_count": 9,
286
+ "metadata": {
287
+ "height": 234
288
+ },
289
+ "outputs": [],
290
+ "source": [
291
+ "data_extraction = Task(\n",
292
+ " description=(\n",
293
+ " \"1. Take the JSON structured data from the Text Parsing Agent.\\n\"\n",
294
+ " \"2. Identify and extract specific data points like project goals, technical requirements,\"\n",
295
+ " \"and stakeholder information.\\n\"\n",
296
+ "\t\t\"3. Organize the extracted data into relevant categories for easy access and use.\\n\"\n",
297
+ " \"4. Format all extracted data into a structured form suitable for document generation,\"\n",
298
+ " \"ensuring it's ready for template insertion.\\n\"\n",
299
+ " ),\n",
300
+ " expected_output=\"A comprehensive list of key data points organized by category, ready for use in document generation.\",\n",
301
+ " agent=data_extraction_agent,\n",
302
+ ")"
303
+ ]
304
+ },
305
+ {
306
+ "cell_type": "markdown",
307
+ "metadata": {},
308
+ "source": [
309
+ "### Task: Edit"
310
+ ]
311
+ },
312
+ {
313
+ "cell_type": "code",
314
+ "execution_count": 10,
315
+ "metadata": {
316
+ "height": 200
317
+ },
318
+ "outputs": [],
319
+ "source": [
320
+ "compile_brd = Task(\n",
321
+ " description=(\n",
322
+ " \"1. Accept the structured and categorized data from the Data Extraction Agent.\\n\"\n",
323
+ " \"2. Open and read the BRD template for data insertion.\\n\"\n",
324
+ " \"3. Insert the received data into the respective sections of the BRD template.\\n\"\n",
325
+ " \"4. Apply formatting rules to ensure the document is professional and adheres to standards.\\n\"\n",
326
+ " \"5. Save the populated and formatted document as a new markdown file, marking the task as complete.\\n\"\n",
327
+ " ),\n",
328
+ " expected_output=\"A complete Business Requirements Document in markdown format, ready for review and distribution.\",\n",
329
+ " agent=brd_compiler_agent\n",
330
+ ")"
331
+ ]
332
+ },
333
+ {
334
+ "cell_type": "markdown",
335
+ "metadata": {},
336
+ "source": [
337
+ "## Creating the Crew\n",
338
+ "\n",
339
+ "- Create your crew of Agents\n",
340
+ "- Pass the tasks to be performed by those agents.\n",
341
+ " - **Note**: *For this simple example*, the tasks will be performed sequentially (i.e they are dependent on each other), so the _order_ of the task in the list _matters_.\n",
342
+ "- `verbose=2` allows you to see all the logs of the execution. "
343
+ ]
344
+ },
345
+ {
346
+ "cell_type": "code",
347
+ "execution_count": 11,
348
+ "metadata": {
349
+ "height": 98
350
+ },
351
+ "outputs": [],
352
+ "source": [
353
+ "crew = Crew(\n",
354
+ " agents=[text_parsing_agent, data_extraction_agent, brd_compiler_agent],\n",
355
+ " tasks=[text_parsing, data_extraction, compile_brd],\n",
356
+ " verbose=2\n",
357
+ ")"
358
+ ]
359
+ },
360
+ {
361
+ "cell_type": "markdown",
362
+ "metadata": {},
363
+ "source": [
364
+ "## Running the Crew"
365
+ ]
366
+ },
367
+ {
368
+ "cell_type": "markdown",
369
+ "metadata": {},
370
+ "source": [
371
+ "**Note**: LLMs can provide different outputs for they same input, so what you get might be different than what you see in the video."
372
+ ]
373
+ },
374
+ {
375
+ "cell_type": "code",
376
+ "execution_count": 12,
377
+ "metadata": {
378
+ "height": 30
379
+ },
380
+ "outputs": [
381
+ {
382
+ "name": "stdout",
383
+ "output_type": "stream",
384
+ "text": [
385
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: Text Interpreter\u001b[00m\n",
386
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Open and read the contents of the input text file.\n",
387
+ "2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\n",
388
+ "3. Extract text under each identified section, ensuring context is preserved.\n",
389
+ "4. Format the extracted text into a JSON structure with labels indicating the typeof content (e.g., heading, detail).\u001b[00m\n",
390
+ "\n",
391
+ "\n",
392
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n"
393
+ ]
394
+ },
395
+ {
396
+ "ename": "AuthenticationError",
397
+ "evalue": "Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-proj-********************************************EQHH. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}",
398
+ "output_type": "error",
399
+ "traceback": [
400
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
401
+ "\u001b[1;31mAuthenticationError\u001b[0m Traceback (most recent call last)",
402
+ "Cell \u001b[1;32mIn[12], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mcrew\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mkickoff\u001b[49m\u001b[43m(\u001b[49m\u001b[43minputs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m{\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\n",
403
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\crew.py:252\u001b[0m, in \u001b[0;36mCrew.kickoff\u001b[1;34m(self, inputs)\u001b[0m\n\u001b[0;32m 249\u001b[0m metrics \u001b[38;5;241m=\u001b[39m []\n\u001b[0;32m 251\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprocess \u001b[38;5;241m==\u001b[39m Process\u001b[38;5;241m.\u001b[39msequential:\n\u001b[1;32m--> 252\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_run_sequential_process\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 253\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprocess \u001b[38;5;241m==\u001b[39m Process\u001b[38;5;241m.\u001b[39mhierarchical:\n\u001b[0;32m 254\u001b[0m result, manager_metrics \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_run_hierarchical_process()\n",
404
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\crew.py:293\u001b[0m, in \u001b[0;36mCrew._run_sequential_process\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 288\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moutput_log_file:\n\u001b[0;32m 289\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_file_handler\u001b[38;5;241m.\u001b[39mlog(\n\u001b[0;32m 290\u001b[0m agent\u001b[38;5;241m=\u001b[39mrole, task\u001b[38;5;241m=\u001b[39mtask\u001b[38;5;241m.\u001b[39mdescription, status\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstarted\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 291\u001b[0m )\n\u001b[1;32m--> 293\u001b[0m output \u001b[38;5;241m=\u001b[39m \u001b[43mtask\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcontext\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtask_output\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 294\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m task\u001b[38;5;241m.\u001b[39masync_execution:\n\u001b[0;32m 295\u001b[0m task_output \u001b[38;5;241m=\u001b[39m output\n",
405
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\task.py:173\u001b[0m, in \u001b[0;36mTask.execute\u001b[1;34m(self, agent, context, tools)\u001b[0m\n\u001b[0;32m 171\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mthread\u001b[38;5;241m.\u001b[39mstart()\n\u001b[0;32m 172\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 173\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 174\u001b[0m \u001b[43m \u001b[49m\u001b[43mtask\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 175\u001b[0m \u001b[43m \u001b[49m\u001b[43magent\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43magent\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 176\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43mtools\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtools\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 178\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 179\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
406
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\task.py:182\u001b[0m, in \u001b[0;36mTask._execute\u001b[1;34m(self, agent, task, context, tools)\u001b[0m\n\u001b[0;32m 181\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_execute\u001b[39m(\u001b[38;5;28mself\u001b[39m, agent, task, context, tools):\n\u001b[1;32m--> 182\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43magent\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute_task\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 183\u001b[0m \u001b[43m \u001b[49m\u001b[43mtask\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtask\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 184\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 185\u001b[0m \u001b[43m \u001b[49m\u001b[43mtools\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtools\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 186\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 188\u001b[0m exported_output \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_export_output(result)\n\u001b[0;32m 190\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moutput \u001b[38;5;241m=\u001b[39m TaskOutput(\n\u001b[0;32m 191\u001b[0m description\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdescription,\n\u001b[0;32m 192\u001b[0m exported_output\u001b[38;5;241m=\u001b[39mexported_output,\n\u001b[0;32m 193\u001b[0m raw_output\u001b[38;5;241m=\u001b[39mresult,\n\u001b[0;32m 194\u001b[0m )\n",
407
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\agent.py:221\u001b[0m, in \u001b[0;36mAgent.execute_task\u001b[1;34m(self, task, context, tools)\u001b[0m\n\u001b[0;32m 218\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magent_executor\u001b[38;5;241m.\u001b[39mtools_description \u001b[38;5;241m=\u001b[39m render_text_description(parsed_tools)\n\u001b[0;32m 219\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39magent_executor\u001b[38;5;241m.\u001b[39mtools_names \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__tools_names(parsed_tools)\n\u001b[1;32m--> 221\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magent_executor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43minvoke\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 222\u001b[0m \u001b[43m \u001b[49m\u001b[43m{\u001b[49m\n\u001b[0;32m 223\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43minput\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtask_prompt\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 224\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtool_names\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magent_executor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtools_names\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 225\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtools\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magent_executor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtools_description\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 226\u001b[0m \u001b[43m \u001b[49m\u001b[43m}\u001b[49m\n\u001b[0;32m 227\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124moutput\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 229\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmax_rpm:\n\u001b[0;32m 230\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rpm_controller\u001b[38;5;241m.\u001b[39mstop_rpm_counter()\n",
408
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain\\chains\\base.py:163\u001b[0m, in \u001b[0;36mChain.invoke\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 161\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 162\u001b[0m run_manager\u001b[38;5;241m.\u001b[39mon_chain_error(e)\n\u001b[1;32m--> 163\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 164\u001b[0m run_manager\u001b[38;5;241m.\u001b[39mon_chain_end(outputs)\n\u001b[0;32m 166\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m include_run_info:\n",
409
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain\\chains\\base.py:153\u001b[0m, in \u001b[0;36mChain.invoke\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 150\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 151\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_validate_inputs(inputs)\n\u001b[0;32m 152\u001b[0m outputs \u001b[38;5;241m=\u001b[39m (\n\u001b[1;32m--> 153\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_call\u001b[49m\u001b[43m(\u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrun_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrun_manager\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 154\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m new_arg_supported\n\u001b[0;32m 155\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_call(inputs)\n\u001b[0;32m 156\u001b[0m )\n\u001b[0;32m 158\u001b[0m final_outputs: Dict[\u001b[38;5;28mstr\u001b[39m, Any] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mprep_outputs(\n\u001b[0;32m 159\u001b[0m inputs, outputs, return_only_outputs\n\u001b[0;32m 160\u001b[0m )\n\u001b[0;32m 161\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
410
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\agents\\executor.py:124\u001b[0m, in \u001b[0;36mCrewAgentExecutor._call\u001b[1;34m(self, inputs, run_manager)\u001b[0m\n\u001b[0;32m 122\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_should_continue(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39miterations, time_elapsed):\n\u001b[0;32m 123\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrequest_within_rpm_limit \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrequest_within_rpm_limit():\n\u001b[1;32m--> 124\u001b[0m next_step_output \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_take_next_step\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 125\u001b[0m \u001b[43m \u001b[49m\u001b[43mname_to_tool_map\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 126\u001b[0m \u001b[43m \u001b[49m\u001b[43mcolor_mapping\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 127\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 128\u001b[0m \u001b[43m \u001b[49m\u001b[43mintermediate_steps\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 129\u001b[0m \u001b[43m \u001b[49m\u001b[43mrun_manager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrun_manager\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 130\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 131\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstep_callback:\n\u001b[0;32m 132\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstep_callback(next_step_output)\n",
411
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain\\agents\\agent.py:1138\u001b[0m, in \u001b[0;36mAgentExecutor._take_next_step\u001b[1;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[0;32m 1129\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_take_next_step\u001b[39m(\n\u001b[0;32m 1130\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 1131\u001b[0m name_to_tool_map: Dict[\u001b[38;5;28mstr\u001b[39m, BaseTool],\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1135\u001b[0m run_manager: Optional[CallbackManagerForChainRun] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 1136\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Union[AgentFinish, List[Tuple[AgentAction, \u001b[38;5;28mstr\u001b[39m]]]:\n\u001b[0;32m 1137\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_consume_next_step(\n\u001b[1;32m-> 1138\u001b[0m \u001b[43m[\u001b[49m\n\u001b[0;32m 1139\u001b[0m \u001b[43m \u001b[49m\u001b[43ma\u001b[49m\n\u001b[0;32m 1140\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43ma\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_iter_next_step\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 1141\u001b[0m \u001b[43m \u001b[49m\u001b[43mname_to_tool_map\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1142\u001b[0m \u001b[43m \u001b[49m\u001b[43mcolor_mapping\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1143\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1144\u001b[0m \u001b[43m \u001b[49m\u001b[43mintermediate_steps\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1145\u001b[0m \u001b[43m \u001b[49m\u001b[43mrun_manager\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1146\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 1147\u001b[0m \u001b[43m \u001b[49m\u001b[43m]\u001b[49m\n\u001b[0;32m 1148\u001b[0m )\n",
412
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain\\agents\\agent.py:1138\u001b[0m, in \u001b[0;36m<listcomp>\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 1129\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_take_next_step\u001b[39m(\n\u001b[0;32m 1130\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 1131\u001b[0m name_to_tool_map: Dict[\u001b[38;5;28mstr\u001b[39m, BaseTool],\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1135\u001b[0m run_manager: Optional[CallbackManagerForChainRun] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 1136\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Union[AgentFinish, List[Tuple[AgentAction, \u001b[38;5;28mstr\u001b[39m]]]:\n\u001b[0;32m 1137\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_consume_next_step(\n\u001b[1;32m-> 1138\u001b[0m \u001b[43m[\u001b[49m\n\u001b[0;32m 1139\u001b[0m \u001b[43m \u001b[49m\u001b[43ma\u001b[49m\n\u001b[0;32m 1140\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43ma\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_iter_next_step\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 1141\u001b[0m \u001b[43m \u001b[49m\u001b[43mname_to_tool_map\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1142\u001b[0m \u001b[43m \u001b[49m\u001b[43mcolor_mapping\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1143\u001b[0m \u001b[43m \u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1144\u001b[0m \u001b[43m \u001b[49m\u001b[43mintermediate_steps\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1145\u001b[0m \u001b[43m \u001b[49m\u001b[43mrun_manager\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 1146\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 1147\u001b[0m \u001b[43m \u001b[49m\u001b[43m]\u001b[49m\n\u001b[0;32m 1148\u001b[0m )\n",
413
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\crewai\\agents\\executor.py:186\u001b[0m, in \u001b[0;36mCrewAgentExecutor._iter_next_step\u001b[1;34m(self, name_to_tool_map, color_mapping, inputs, intermediate_steps, run_manager)\u001b[0m\n\u001b[0;32m 183\u001b[0m intermediate_steps \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_prepare_intermediate_steps(intermediate_steps)\n\u001b[0;32m 185\u001b[0m \u001b[38;5;66;03m# Call the LLM to see what to do.\u001b[39;00m\n\u001b[1;32m--> 186\u001b[0m output \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43magent\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mplan\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 187\u001b[0m \u001b[43m \u001b[49m\u001b[43mintermediate_steps\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 188\u001b[0m \u001b[43m \u001b[49m\u001b[43mcallbacks\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrun_manager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_child\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mrun_manager\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m 189\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 190\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 192\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m OutputParserException \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 193\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandle_parsing_errors, \u001b[38;5;28mbool\u001b[39m):\n",
414
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain\\agents\\agent.py:397\u001b[0m, in \u001b[0;36mRunnableAgent.plan\u001b[1;34m(self, intermediate_steps, callbacks, **kwargs)\u001b[0m\n\u001b[0;32m 389\u001b[0m final_output: Any \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 390\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstream_runnable:\n\u001b[0;32m 391\u001b[0m \u001b[38;5;66;03m# Use streaming to make sure that the underlying LLM is invoked in a\u001b[39;00m\n\u001b[0;32m 392\u001b[0m \u001b[38;5;66;03m# streaming\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 395\u001b[0m \u001b[38;5;66;03m# Because the response from the plan is not a generator, we need to\u001b[39;00m\n\u001b[0;32m 396\u001b[0m \u001b[38;5;66;03m# accumulate the output into final output and return that.\u001b[39;00m\n\u001b[1;32m--> 397\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mchunk\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrunnable\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m(\u001b[49m\u001b[43minputs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mcallbacks\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mcallbacks\u001b[49m\u001b[43m}\u001b[49m\u001b[43m)\u001b[49m\u001b[43m:\u001b[49m\n\u001b[0;32m 398\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfinal_output\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m:\u001b[49m\n\u001b[0;32m 399\u001b[0m \u001b[43m \u001b[49m\u001b[43mfinal_output\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mchunk\u001b[49m\n",
415
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:2875\u001b[0m, in \u001b[0;36mRunnableSequence.stream\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 2869\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mstream\u001b[39m(\n\u001b[0;32m 2870\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 2871\u001b[0m \u001b[38;5;28minput\u001b[39m: Input,\n\u001b[0;32m 2872\u001b[0m config: Optional[RunnableConfig] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 2873\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Optional[Any],\n\u001b[0;32m 2874\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[Output]:\n\u001b[1;32m-> 2875\u001b[0m \u001b[38;5;28;01myield from\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mtransform(\u001b[38;5;28miter\u001b[39m([\u001b[38;5;28minput\u001b[39m]), config, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
416
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:2862\u001b[0m, in \u001b[0;36mRunnableSequence.transform\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 2856\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mtransform\u001b[39m(\n\u001b[0;32m 2857\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 2858\u001b[0m \u001b[38;5;28minput\u001b[39m: Iterator[Input],\n\u001b[0;32m 2859\u001b[0m config: Optional[RunnableConfig] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 2860\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Optional[Any],\n\u001b[0;32m 2861\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[Output]:\n\u001b[1;32m-> 2862\u001b[0m \u001b[38;5;28;01myield from\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_transform_stream_with_config(\n\u001b[0;32m 2863\u001b[0m \u001b[38;5;28minput\u001b[39m,\n\u001b[0;32m 2864\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_transform,\n\u001b[0;32m 2865\u001b[0m patch_config(config, run_name\u001b[38;5;241m=\u001b[39m(config \u001b[38;5;129;01mor\u001b[39;00m {})\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_name\u001b[39m\u001b[38;5;124m\"\u001b[39m) \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mname),\n\u001b[0;32m 2866\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 2867\u001b[0m )\n",
417
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:1881\u001b[0m, in \u001b[0;36mRunnable._transform_stream_with_config\u001b[1;34m(self, input, transformer, config, run_type, **kwargs)\u001b[0m\n\u001b[0;32m 1879\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 1880\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m-> 1881\u001b[0m chunk: Output \u001b[38;5;241m=\u001b[39m \u001b[43mcontext\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mnext\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43miterator\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[0;32m 1882\u001b[0m \u001b[38;5;28;01myield\u001b[39;00m chunk\n\u001b[0;32m 1883\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m final_output_supported:\n",
418
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:2826\u001b[0m, in \u001b[0;36mRunnableSequence._transform\u001b[1;34m(self, input, run_manager, config)\u001b[0m\n\u001b[0;32m 2817\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m step \u001b[38;5;129;01min\u001b[39;00m steps:\n\u001b[0;32m 2818\u001b[0m final_pipeline \u001b[38;5;241m=\u001b[39m step\u001b[38;5;241m.\u001b[39mtransform(\n\u001b[0;32m 2819\u001b[0m final_pipeline,\n\u001b[0;32m 2820\u001b[0m patch_config(\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 2823\u001b[0m ),\n\u001b[0;32m 2824\u001b[0m )\n\u001b[1;32m-> 2826\u001b[0m \u001b[43m\u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfinal_pipeline\u001b[49m\u001b[43m:\u001b[49m\n\u001b[0;32m 2827\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01myield\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43moutput\u001b[49m\n",
419
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:1282\u001b[0m, in \u001b[0;36mRunnable.transform\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 1279\u001b[0m final: Input\n\u001b[0;32m 1280\u001b[0m got_first_val \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n\u001b[1;32m-> 1282\u001b[0m \u001b[43m\u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43michunk\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43minput\u001b[39;49m\u001b[43m:\u001b[49m\n\u001b[0;32m 1283\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# The default implementation of transform is to buffer input and\u001b[39;49;00m\n\u001b[0;32m 1284\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# then call stream.\u001b[39;49;00m\n\u001b[0;32m 1285\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# It'll attempt to gather all input into a single chunk using\u001b[39;49;00m\n\u001b[0;32m 1286\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# the `+` operator.\u001b[39;49;00m\n\u001b[0;32m 1287\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# If the input is not addable, then we'll assume that we can\u001b[39;49;00m\n\u001b[0;32m 1288\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# only operate on the last chunk,\u001b[39;49;00m\n\u001b[0;32m 1289\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;66;43;03m# and we'll iterate until we get to the last chunk.\u001b[39;49;00m\n\u001b[0;32m 1290\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mnot\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mgot_first_val\u001b[49m\u001b[43m:\u001b[49m\n\u001b[0;32m 1291\u001b[0m \u001b[43m \u001b[49m\u001b[43mfinal\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43michunk\u001b[49m\n",
420
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:4736\u001b[0m, in \u001b[0;36mRunnableBindingBase.transform\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 4730\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mtransform\u001b[39m(\n\u001b[0;32m 4731\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 4732\u001b[0m \u001b[38;5;28minput\u001b[39m: Iterator[Input],\n\u001b[0;32m 4733\u001b[0m config: Optional[RunnableConfig] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 4734\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any,\n\u001b[0;32m 4735\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Iterator[Output]:\n\u001b[1;32m-> 4736\u001b[0m \u001b[38;5;28;01myield from\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mbound\u001b[38;5;241m.\u001b[39mtransform(\n\u001b[0;32m 4737\u001b[0m \u001b[38;5;28minput\u001b[39m,\n\u001b[0;32m 4738\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_merge_configs(config),\n\u001b[0;32m 4739\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m{\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkwargs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs},\n\u001b[0;32m 4740\u001b[0m )\n",
421
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\runnables\\base.py:1300\u001b[0m, in \u001b[0;36mRunnable.transform\u001b[1;34m(self, input, config, **kwargs)\u001b[0m\n\u001b[0;32m 1297\u001b[0m final \u001b[38;5;241m=\u001b[39m ichunk\n\u001b[0;32m 1299\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m got_first_val:\n\u001b[1;32m-> 1300\u001b[0m \u001b[38;5;28;01myield from\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstream(final, config, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
422
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:249\u001b[0m, in \u001b[0;36mBaseChatModel.stream\u001b[1;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[0;32m 242\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 243\u001b[0m run_manager\u001b[38;5;241m.\u001b[39mon_llm_error(\n\u001b[0;32m 244\u001b[0m e,\n\u001b[0;32m 245\u001b[0m response\u001b[38;5;241m=\u001b[39mLLMResult(\n\u001b[0;32m 246\u001b[0m generations\u001b[38;5;241m=\u001b[39m[[generation]] \u001b[38;5;28;01mif\u001b[39;00m generation \u001b[38;5;28;01melse\u001b[39;00m []\n\u001b[0;32m 247\u001b[0m ),\n\u001b[0;32m 248\u001b[0m )\n\u001b[1;32m--> 249\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 250\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 251\u001b[0m run_manager\u001b[38;5;241m.\u001b[39mon_llm_end(LLMResult(generations\u001b[38;5;241m=\u001b[39m[[generation]]))\n",
423
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:229\u001b[0m, in \u001b[0;36mBaseChatModel.stream\u001b[1;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[0;32m 227\u001b[0m generation: Optional[ChatGenerationChunk] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 228\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m--> 229\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mchunk\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_stream\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmessages\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstop\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstop\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\u001b[43m:\u001b[49m\n\u001b[0;32m 230\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mchunk\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmessage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mid\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mis\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m:\u001b[49m\n\u001b[0;32m 231\u001b[0m \u001b[43m \u001b[49m\u001b[43mchunk\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmessage\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mid\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mrun-\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mrun_manager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_id\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\n",
424
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\langchain_openai\\chat_models\\base.py:408\u001b[0m, in \u001b[0;36mChatOpenAI._stream\u001b[1;34m(self, messages, stop, run_manager, **kwargs)\u001b[0m\n\u001b[0;32m 405\u001b[0m params \u001b[38;5;241m=\u001b[39m {\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstream\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mTrue\u001b[39;00m}\n\u001b[0;32m 407\u001b[0m default_chunk_class \u001b[38;5;241m=\u001b[39m AIMessageChunk\n\u001b[1;32m--> 408\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m chunk \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mclient\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmessages\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmessage_dicts\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[0;32m 409\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(chunk, \u001b[38;5;28mdict\u001b[39m):\n\u001b[0;32m 410\u001b[0m chunk \u001b[38;5;241m=\u001b[39m chunk\u001b[38;5;241m.\u001b[39mdict()\n",
425
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\openai\\_utils\\_utils.py:277\u001b[0m, in \u001b[0;36mrequired_args.<locals>.inner.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 275\u001b[0m msg \u001b[38;5;241m=\u001b[39m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mMissing required argument: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mquote(missing[\u001b[38;5;241m0\u001b[39m])\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 276\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m(msg)\n\u001b[1;32m--> 277\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
426
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\openai\\resources\\chat\\completions.py:606\u001b[0m, in \u001b[0;36mCompletions.create\u001b[1;34m(self, messages, model, frequency_penalty, function_call, functions, logit_bias, logprobs, max_tokens, n, parallel_tool_calls, presence_penalty, response_format, seed, stop, stream, stream_options, temperature, tool_choice, tools, top_logprobs, top_p, user, extra_headers, extra_query, extra_body, timeout)\u001b[0m\n\u001b[0;32m 573\u001b[0m \u001b[38;5;129m@required_args\u001b[39m([\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmessages\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodel\u001b[39m\u001b[38;5;124m\"\u001b[39m], [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmessages\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodel\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstream\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n\u001b[0;32m 574\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcreate\u001b[39m(\n\u001b[0;32m 575\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 604\u001b[0m timeout: \u001b[38;5;28mfloat\u001b[39m \u001b[38;5;241m|\u001b[39m httpx\u001b[38;5;241m.\u001b[39mTimeout \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m|\u001b[39m NotGiven \u001b[38;5;241m=\u001b[39m NOT_GIVEN,\n\u001b[0;32m 605\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ChatCompletion \u001b[38;5;241m|\u001b[39m Stream[ChatCompletionChunk]:\n\u001b[1;32m--> 606\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_post\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 607\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/chat/completions\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 608\u001b[0m \u001b[43m \u001b[49m\u001b[43mbody\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmaybe_transform\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 609\u001b[0m \u001b[43m \u001b[49m\u001b[43m{\u001b[49m\n\u001b[0;32m 610\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmessages\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmessages\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 611\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmodel\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmodel\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 612\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mfrequency_penalty\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfrequency_penalty\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 613\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mfunction_call\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunction_call\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 614\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mfunctions\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mfunctions\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 615\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mlogit_bias\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mlogit_bias\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 616\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mlogprobs\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mlogprobs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 617\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mmax_tokens\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mmax_tokens\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 618\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mn\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mn\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 619\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mparallel_tool_calls\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mparallel_tool_calls\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 620\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mpresence_penalty\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mpresence_penalty\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 621\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mresponse_format\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mresponse_format\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 622\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mseed\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mseed\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 623\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstop\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstop\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 624\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstream\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 625\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstream_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 626\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtemperature\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtemperature\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 627\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtool_choice\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtool_choice\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 628\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtools\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtools\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 629\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtop_logprobs\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtop_logprobs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 630\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtop_p\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mtop_p\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 631\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43muser\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43muser\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 632\u001b[0m \u001b[43m \u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 633\u001b[0m \u001b[43m \u001b[49m\u001b[43mcompletion_create_params\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mCompletionCreateParams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 634\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 635\u001b[0m \u001b[43m \u001b[49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmake_request_options\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 636\u001b[0m \u001b[43m \u001b[49m\u001b[43mextra_headers\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mextra_headers\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mextra_query\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mextra_query\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mextra_body\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mextra_body\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtimeout\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtimeout\u001b[49m\n\u001b[0;32m 637\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 638\u001b[0m \u001b[43m \u001b[49m\u001b[43mcast_to\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mChatCompletion\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 639\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[0;32m 640\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mStream\u001b[49m\u001b[43m[\u001b[49m\u001b[43mChatCompletionChunk\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 641\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
427
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\openai\\_base_client.py:1240\u001b[0m, in \u001b[0;36mSyncAPIClient.post\u001b[1;34m(self, path, cast_to, body, options, files, stream, stream_cls)\u001b[0m\n\u001b[0;32m 1226\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpost\u001b[39m(\n\u001b[0;32m 1227\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 1228\u001b[0m path: \u001b[38;5;28mstr\u001b[39m,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1235\u001b[0m stream_cls: \u001b[38;5;28mtype\u001b[39m[_StreamT] \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 1236\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ResponseT \u001b[38;5;241m|\u001b[39m _StreamT:\n\u001b[0;32m 1237\u001b[0m opts \u001b[38;5;241m=\u001b[39m FinalRequestOptions\u001b[38;5;241m.\u001b[39mconstruct(\n\u001b[0;32m 1238\u001b[0m method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpost\u001b[39m\u001b[38;5;124m\"\u001b[39m, url\u001b[38;5;241m=\u001b[39mpath, json_data\u001b[38;5;241m=\u001b[39mbody, files\u001b[38;5;241m=\u001b[39mto_httpx_files(files), \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39moptions\n\u001b[0;32m 1239\u001b[0m )\n\u001b[1;32m-> 1240\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m cast(ResponseT, \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrequest\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcast_to\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mopts\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream_cls\u001b[49m\u001b[43m)\u001b[49m)\n",
428
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\openai\\_base_client.py:921\u001b[0m, in \u001b[0;36mSyncAPIClient.request\u001b[1;34m(self, cast_to, options, remaining_retries, stream, stream_cls)\u001b[0m\n\u001b[0;32m 912\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrequest\u001b[39m(\n\u001b[0;32m 913\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 914\u001b[0m cast_to: Type[ResponseT],\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 919\u001b[0m stream_cls: \u001b[38;5;28mtype\u001b[39m[_StreamT] \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 920\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ResponseT \u001b[38;5;241m|\u001b[39m _StreamT:\n\u001b[1;32m--> 921\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 922\u001b[0m \u001b[43m \u001b[49m\u001b[43mcast_to\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcast_to\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 923\u001b[0m \u001b[43m \u001b[49m\u001b[43moptions\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43moptions\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 924\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 925\u001b[0m \u001b[43m \u001b[49m\u001b[43mstream_cls\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstream_cls\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 926\u001b[0m \u001b[43m \u001b[49m\u001b[43mremaining_retries\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mremaining_retries\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 927\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
429
+ "File \u001b[1;32mc:\\Users\\Fozan\\Downloads\\OneDrive_2024-06-09\\.venv\\Lib\\site-packages\\openai\\_base_client.py:1020\u001b[0m, in \u001b[0;36mSyncAPIClient._request\u001b[1;34m(self, cast_to, options, remaining_retries, stream, stream_cls)\u001b[0m\n\u001b[0;32m 1017\u001b[0m err\u001b[38;5;241m.\u001b[39mresponse\u001b[38;5;241m.\u001b[39mread()\n\u001b[0;32m 1019\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRe-raising status error\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m-> 1020\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_status_error_from_response(err\u001b[38;5;241m.\u001b[39mresponse) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 1022\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_process_response(\n\u001b[0;32m 1023\u001b[0m cast_to\u001b[38;5;241m=\u001b[39mcast_to,\n\u001b[0;32m 1024\u001b[0m options\u001b[38;5;241m=\u001b[39moptions,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1027\u001b[0m stream_cls\u001b[38;5;241m=\u001b[39mstream_cls,\n\u001b[0;32m 1028\u001b[0m )\n",
430
+ "\u001b[1;31mAuthenticationError\u001b[0m: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-proj-********************************************EQHH. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}"
431
+ ]
432
+ }
433
+ ],
434
+ "source": [
435
+ "\n",
436
+ "\n",
437
+ "result = crew.kickoff(inputs={})"
438
+ ]
439
+ },
440
+ {
441
+ "cell_type": "markdown",
442
+ "metadata": {},
443
+ "source": [
444
+ "- Display the results of your execution as markdown in the notebook."
445
+ ]
446
+ },
447
+ {
448
+ "cell_type": "code",
449
+ "execution_count": null,
450
+ "metadata": {
451
+ "height": 47
452
+ },
453
+ "outputs": [
454
+ {
455
+ "data": {
456
+ "text/markdown": [
457
+ "# Business Requirements Document\n",
458
+ "\n",
459
+ "## Project Goals:\n",
460
+ "1. **Increase customer engagement by 20% within the next quarter**\n",
461
+ "2. **Implement a new CRM system to streamline communication**\n",
462
+ "\n",
463
+ "## Technical Requirements:\n",
464
+ "1. **Integration with existing database systems**\n",
465
+ "2. **Mobile responsiveness for all user interfaces**\n",
466
+ "\n",
467
+ "## Stakeholder Information:\n",
468
+ "1. **Stakeholder 1:**\n",
469
+ " - **Name:** John Smith\n",
470
+ " - **Role:** Project Manager\n",
471
+ " - **Contact:** jsmith@email.com\n",
472
+ "\n",
473
+ "2. **Stakeholder 2:**\n",
474
+ " - **Name:** Emily Johnson\n",
475
+ " - **Role:** Lead Developer\n",
476
+ " - **Contact:** ejohnson@email.com"
477
+ ],
478
+ "text/plain": [
479
+ "<IPython.core.display.Markdown object>"
480
+ ]
481
+ },
482
+ "execution_count": 27,
483
+ "metadata": {},
484
+ "output_type": "execute_result"
485
+ }
486
+ ],
487
+ "source": [
488
+ "from IPython.display import Markdown\n",
489
+ "Markdown(result)"
490
+ ]
491
+ },
492
+ {
493
+ "cell_type": "code",
494
+ "execution_count": null,
495
+ "metadata": {
496
+ "height": 30
497
+ },
498
+ "outputs": [
499
+ {
500
+ "name": "stdout",
501
+ "output_type": "stream",
502
+ "text": [
503
+ "Python 3.11.9\n"
504
+ ]
505
+ }
506
+ ],
507
+ "source": [
508
+ "!python --version"
509
+ ]
510
+ }
511
+ ],
512
+ "metadata": {
513
+ "colab": {
514
+ "gpuType": "T4",
515
+ "provenance": []
516
+ },
517
+ "kernelspec": {
518
+ "display_name": "Python 3 (ipykernel)",
519
+ "language": "python",
520
+ "name": "python3"
521
+ },
522
+ "language_info": {
523
+ "codemirror_mode": {
524
+ "name": "ipython",
525
+ "version": 3
526
+ },
527
+ "file_extension": ".py",
528
+ "mimetype": "text/x-python",
529
+ "name": "python",
530
+ "nbconvert_exporter": "python",
531
+ "pygments_lexer": "ipython3",
532
+ "version": "3.11.9"
533
+ }
534
+ },
535
+ "nbformat": 4,
536
+ "nbformat_minor": 4
537
+ }
Multi-Agent BRD Generator/script.ipynb ADDED
@@ -0,0 +1,1212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "You can download the `requirements.txt` for this course from the workspace of this lab. `File --> Open...`"
8
+ ]
9
+ },
10
+ {
11
+ "cell_type": "markdown",
12
+ "metadata": {},
13
+ "source": [
14
+ "# Create Agents to generate BRD Document from Meeting Transcription"
15
+ ]
16
+ },
17
+ {
18
+ "cell_type": "markdown",
19
+ "metadata": {},
20
+ "source": [
21
+ "The libraries are already installed in the classroom. If you're running this notebook on your own machine, you can install the following:\n",
22
+ "```Python\n",
23
+ "!pip install crewai==0.28.8 crewai_tools==0.1.6 langchain_community==0.0.29\n",
24
+ "```"
25
+ ]
26
+ },
27
+ {
28
+ "cell_type": "code",
29
+ "execution_count": 1,
30
+ "metadata": {
31
+ "height": 64
32
+ },
33
+ "outputs": [],
34
+ "source": [
35
+ "# Warning control\n",
36
+ "import warnings\n",
37
+ "warnings.filterwarnings('ignore')"
38
+ ]
39
+ },
40
+ {
41
+ "cell_type": "markdown",
42
+ "metadata": {},
43
+ "source": [
44
+ "- Import from the crewAI libray."
45
+ ]
46
+ },
47
+ {
48
+ "cell_type": "code",
49
+ "execution_count": 2,
50
+ "metadata": {
51
+ "height": 166
52
+ },
53
+ "outputs": [],
54
+ "source": [
55
+ "from crewai import Agent, Task, Crew\n",
56
+ "from crewai_tools import (\n",
57
+ " DirectoryReadTool,\n",
58
+ " FileReadTool,\n",
59
+ " #SerperDevTool,\n",
60
+ " #WebsiteSearchTool,\n",
61
+ " DOCXSearchTool,\n",
62
+ " #RagTool,\n",
63
+ " TXTSearchTool\n",
64
+ ")"
65
+ ]
66
+ },
67
+ {
68
+ "cell_type": "markdown",
69
+ "metadata": {},
70
+ "source": [
71
+ "- As a LLM for your agents, we'll be using OpenAI's `gpt-3.5-turbo`."
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "code",
76
+ "execution_count": 3,
77
+ "metadata": {
78
+ "height": 149
79
+ },
80
+ "outputs": [],
81
+ "source": [
82
+ "import os\n",
83
+ "from utils import get_openai_api_key\n",
84
+ "\n",
85
+ "# Set up API keys\n",
86
+ "\n",
87
+ "openai_api_key = get_openai_api_key()\n",
88
+ "\n",
89
+ "os.environ[\"OPENAI_MODEL_NAME\"] = 'gpt-3.5-turbo'\n",
90
+ "#os.environ[\"OPENAI_API_KEY\"] = \"sk-proj-IxpeA8VEYw08rabRX2yOT3BlbkFJvCwzUhKvE5Aqq6rB71Zh\"\n"
91
+ ]
92
+ },
93
+ {
94
+ "cell_type": "code",
95
+ "execution_count": 4,
96
+ "metadata": {
97
+ "height": 132
98
+ },
99
+ "outputs": [],
100
+ "source": [
101
+ "# Instantiate tools\n",
102
+ "#meeting_trans_docs_tool = DirectoryReadTool(directory='./meeting-transcription')\n",
103
+ "brd_temp_docs_tool = DirectoryReadTool(directory='./brd-template')\n",
104
+ "file_tool = FileReadTool()\n",
105
+ "#web_rag_tool = WebsiteSearchTool()\n",
106
+ "docx_search_tool = DOCXSearchTool()\n",
107
+ "#rag_tool = RagTool()\n",
108
+ "mt_tool = TXTSearchTool(txt='./meeting-transcription/meeting-transcript.txt')\n",
109
+ "brd_tool = TXTSearchTool(txt='./brd-template/brd-template.txt')"
110
+ ]
111
+ },
112
+ {
113
+ "cell_type": "markdown",
114
+ "metadata": {},
115
+ "source": [
116
+ "## Creating Agents\n",
117
+ "\n",
118
+ "- Define your Agents, and provide them a `role`, `goal` and `backstory`.\n",
119
+ "- It has been seen that LLMs perform better when they are role playing."
120
+ ]
121
+ },
122
+ {
123
+ "cell_type": "markdown",
124
+ "metadata": {},
125
+ "source": [
126
+ "### Agent: Planner\n",
127
+ "\n",
128
+ "**Note**: The benefit of using _multiple strings_ :\n",
129
+ "```Python\n",
130
+ "varname = \"line 1 of text\"\n",
131
+ " \"line 2 of text\"\n",
132
+ "```\n",
133
+ "\n",
134
+ "versus the _triple quote docstring_:\n",
135
+ "```Python\n",
136
+ "varname = \"\"\"line 1 of text\n",
137
+ " line 2 of text\n",
138
+ " \"\"\"\n",
139
+ "```\n",
140
+ "is that it can avoid adding those whitespaces and newline characters, making it better formatted to be passed to the LLM."
141
+ ]
142
+ },
143
+ {
144
+ "cell_type": "code",
145
+ "execution_count": 5,
146
+ "metadata": {
147
+ "height": 200
148
+ },
149
+ "outputs": [],
150
+ "source": [
151
+ "text_parsing_agent = Agent(\n",
152
+ " role=\"Text Interpreter\",\n",
153
+ " goal=\"Parse and interpret the raw text input, structuring it into manageable sections\"\n",
154
+ " \"or data points that are relevant for analysis and processing.\",\n",
155
+ " backstory=\"You excel at deciphering complex textual data. You act as the first line of analysis,\"\n",
156
+ " \"turning unstructured text into organized segments. You should enhance efficiency in data\"\n",
157
+ " \"handling and support subsequent stages of data processing.\",\n",
158
+ " tools=[mt_tool],\n",
159
+ " allow_delegation=True,\n",
160
+ "\tverbose=True\n",
161
+ ")"
162
+ ]
163
+ },
164
+ {
165
+ "cell_type": "markdown",
166
+ "metadata": {},
167
+ "source": [
168
+ "### Agent: Writer"
169
+ ]
170
+ },
171
+ {
172
+ "cell_type": "code",
173
+ "execution_count": 6,
174
+ "metadata": {
175
+ "height": 217
176
+ },
177
+ "outputs": [],
178
+ "source": [
179
+ "data_extraction_agent = Agent(\n",
180
+ " role=\"Data Extraction Agent\",\n",
181
+ " goal=\"Identify and extract essential data points, statistics,\"\n",
182
+ " \"and specific information from the parsed text that are crucial\"\n",
183
+ " \"for drafting a Business Requirements Document.\",\n",
184
+ " backstory=\"You should tackle the challenge of sifting through detailed textual data to\"\n",
185
+ " \"find relevant information. You should be doing it with precision and speed, equipped\"\n",
186
+ " \"with capabilities to recognize and categorize data efficiently, making it invaluable\"\n",
187
+ " \"for projects requiring quick turnaround and accurate data handling.\",\n",
188
+ " tools=[mt_tool, docx_search_tool, brd_temp_docs_tool, file_tool],\n",
189
+ " allow_delegation=True,\n",
190
+ " verbose=True\n",
191
+ ")"
192
+ ]
193
+ },
194
+ {
195
+ "cell_type": "markdown",
196
+ "metadata": {},
197
+ "source": [
198
+ "### Agent: Editor"
199
+ ]
200
+ },
201
+ {
202
+ "cell_type": "code",
203
+ "execution_count": 7,
204
+ "metadata": {
205
+ "height": 251
206
+ },
207
+ "outputs": [],
208
+ "source": [
209
+ "brd_compiler_agent = Agent(\n",
210
+ " role=\"BRD Compiler\",\n",
211
+ " goal=\"Assemble the extracted data into a well-structured Business Requirements Document,\"\n",
212
+ " \"ensuring that it is clear, coherent, and formatted according to standards.\",\n",
213
+ " backstory=\"You are a meticulous Business Requirement Document compiler, You should alleviate\"\n",
214
+ " \"the burdens of manual document assembly. Ensure that all documents are crafted with\"\n",
215
+ " \"precision, adhering to organizational standards, and ready for stakeholder review. You\"\n",
216
+ " \"should be automating routine documentation tasks, thus allowing human team members to focus\"\n",
217
+ " \"on more strategic activities.\",\n",
218
+ " tools=[docx_search_tool, brd_temp_docs_tool, file_tool],\n",
219
+ " output_file='./generated-brd/brd.md', # The final blog post will be saved here\n",
220
+ " allow_delegation=True,\n",
221
+ " verbose=True\n",
222
+ ")"
223
+ ]
224
+ },
225
+ {
226
+ "cell_type": "markdown",
227
+ "metadata": {},
228
+ "source": [
229
+ "## Creating Tasks\n",
230
+ "\n",
231
+ "- Define your Tasks, and provide them a `description`, `expected_output` and `agent`."
232
+ ]
233
+ },
234
+ {
235
+ "cell_type": "markdown",
236
+ "metadata": {},
237
+ "source": [
238
+ "### Task: Text Parsing"
239
+ ]
240
+ },
241
+ {
242
+ "cell_type": "code",
243
+ "execution_count": 8,
244
+ "metadata": {
245
+ "height": 217
246
+ },
247
+ "outputs": [],
248
+ "source": [
249
+ "text_parsing = Task(\n",
250
+ " description=(\n",
251
+ " \"1. Open and read the contents of the input text file.\\n\"\n",
252
+ " \"2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\\n\"\n",
253
+ " \"3. Extract text under each identified section, ensuring context is preserved.\\n\"\n",
254
+ " \"4. Format the extracted text into a JSON structure with labels indicating the type\"\n",
255
+ " \"of content (e.g., heading, detail).\"\n",
256
+ " ),\n",
257
+ " expected_output=\"Structured JSON object containing separated sections of\"\n",
258
+ " \"text with labels based on their content type.\",\n",
259
+ " agent=text_parsing_agent,\n",
260
+ ")"
261
+ ]
262
+ },
263
+ {
264
+ "cell_type": "markdown",
265
+ "metadata": {},
266
+ "source": [
267
+ "### Task: Data Extraction"
268
+ ]
269
+ },
270
+ {
271
+ "cell_type": "code",
272
+ "execution_count": 9,
273
+ "metadata": {
274
+ "height": 234
275
+ },
276
+ "outputs": [],
277
+ "source": [
278
+ "data_extraction = Task(\n",
279
+ " description=(\n",
280
+ " \"1. Take the JSON structured data from the Text Parsing Agent.\\n\"\n",
281
+ " \"2. Identify and extract specific data points like project goals, technical requirements,\"\n",
282
+ " \"and stakeholder information.\\n\"\n",
283
+ "\t\t\"3. Organize the extracted data into relevant categories for easy access and use.\\n\"\n",
284
+ " \"4. Format all extracted data into a structured form suitable for document generation,\"\n",
285
+ " \"ensuring it's ready for template insertion.\\n\"\n",
286
+ " ),\n",
287
+ " expected_output=\"A comprehensive list of key data points organized by category, ready for use in document generation.\",\n",
288
+ " agent=data_extraction_agent,\n",
289
+ ")"
290
+ ]
291
+ },
292
+ {
293
+ "cell_type": "markdown",
294
+ "metadata": {},
295
+ "source": [
296
+ "### Task: BRD Compilation"
297
+ ]
298
+ },
299
+ {
300
+ "cell_type": "code",
301
+ "execution_count": 10,
302
+ "metadata": {
303
+ "height": 200
304
+ },
305
+ "outputs": [],
306
+ "source": [
307
+ "compile_brd = Task(\n",
308
+ " description=(\n",
309
+ " \"1. Accept the structured and categorized data from the Data Extraction Agent.\\n\"\n",
310
+ " \"2. Open and read the BRD template for data insertion.\\n\"\n",
311
+ " \"3. Insert the received data into the respective sections of the BRD template.\\n\"\n",
312
+ " \"4. Apply formatting rules to ensure the document is professional and adheres to standards.\\n\"\n",
313
+ " \"5. Save the populated and formatted document as a new markdown file, marking the task as complete.\\n\"\n",
314
+ " ),\n",
315
+ " expected_output=\"A complete Business Requirements Document in markdown format, ready for review and distribution.\",\n",
316
+ " agent=brd_compiler_agent\n",
317
+ ")"
318
+ ]
319
+ },
320
+ {
321
+ "cell_type": "markdown",
322
+ "metadata": {},
323
+ "source": [
324
+ "## Creating the Crew\n",
325
+ "\n",
326
+ "- Create your crew of Agents\n",
327
+ "- Pass the tasks to be performed by those agents.\n",
328
+ " - **Note**: *For this simple example*, the tasks will be performed sequentially (i.e they are dependent on each other), so the _order_ of the task in the list _matters_.\n",
329
+ "- `verbose=2` allows you to see all the logs of the execution. "
330
+ ]
331
+ },
332
+ {
333
+ "cell_type": "code",
334
+ "execution_count": 11,
335
+ "metadata": {
336
+ "height": 98
337
+ },
338
+ "outputs": [],
339
+ "source": [
340
+ "crew = Crew(\n",
341
+ " agents=[text_parsing_agent, data_extraction_agent, brd_compiler_agent],\n",
342
+ " tasks=[text_parsing, data_extraction, compile_brd],\n",
343
+ " verbose=2\n",
344
+ ")"
345
+ ]
346
+ },
347
+ {
348
+ "cell_type": "markdown",
349
+ "metadata": {},
350
+ "source": [
351
+ "## Running the Crew"
352
+ ]
353
+ },
354
+ {
355
+ "cell_type": "markdown",
356
+ "metadata": {},
357
+ "source": [
358
+ "**Note**: LLMs can provide different outputs for they same input, so what you get might be different than what you see in the video."
359
+ ]
360
+ },
361
+ {
362
+ "cell_type": "code",
363
+ "execution_count": 12,
364
+ "metadata": {
365
+ "height": 30
366
+ },
367
+ "outputs": [
368
+ {
369
+ "name": "stdout",
370
+ "output_type": "stream",
371
+ "text": [
372
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: Text Interpreter\u001b[00m\n",
373
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Open and read the contents of the input text file.\n",
374
+ "2. Analyze the document structure to identify headings, subheadings, and key paragraphs.\n",
375
+ "3. Extract text under each identified section, ensuring context is preserved.\n",
376
+ "4. Format the extracted text into a JSON structure with labels indicating the typeof content (e.g., heading, detail).\u001b[00m\n",
377
+ "\n",
378
+ "\n",
379
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
380
+ "\u001b[32;1m\u001b[1;3mI need to start by searching the content of the meeting-transcription.txt file to understand the structure of the document and identify headings, subheadings, and key paragraphs.\n",
381
+ "\n",
382
+ "Action: Search a txt's content\n",
383
+ "Action Input: {\"query\": \"meeting-transcription.txt\"}\u001b[0m\u001b[91m \n",
384
+ "\n",
385
+ "I encountered an error while trying to use the tool. This was the error: TXTSearchTool._run() missing 1 required positional argument: 'search_query'.\n",
386
+ " Tool Search a txt's content accepts these inputs: A tool that can be used to semantic search a query the ./meeting-transcription/meeting-transcript.txt txt's content.\n",
387
+ "\u001b[00m\n",
388
+ "\u001b[32;1m\u001b[1;3mThought: I need to delegate the task of analyzing the document structure to the Data Extraction Agent to identify headings, subheadings, and key paragraphs.\n",
389
+ "\n",
390
+ "Action: Delegate work to co-worker\n",
391
+ "Action Input: {\"coworker\": \"Data Extraction Agent\", \"task\": \"Identify document structure, headings, subheadings, key paragraphs\", \"context\": \"The Data Extraction Agent needs to analyze the meeting-transcription.txt document structure to identify headings, subheadings, and key paragraphs.\"}\u001b[0m\n",
392
+ "\n",
393
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
394
+ "\u001b[32;1m\u001b[1;3mI need to start by reading the content of the meeting-transcription.txt document to analyze its structure and identify headings, subheadings, and key paragraphs.\n",
395
+ "\n",
396
+ "Action: Read a file's content\n",
397
+ "Action Input: {\"file_path\": \"./meeting-transcription/meeting-transcript.txt\"}\n",
398
+ "\u001b[0m\u001b[95m \n",
399
+ "\n",
400
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
401
+ " \n",
402
+ "Date: June 7, 2024\n",
403
+ "Time: 9:00 AM to 12:00 PM\n",
404
+ "Location: Conference Room B\n",
405
+ "Attendees:\n",
406
+ " \n",
407
+ "Alex Johnson (Project Manager)\n",
408
+ "Sam Lee (Business Analyst)\n",
409
+ "Jessica Davis (Technical Lead) \n",
410
+ "Chris Smith (Quality Assurance Manager)\n",
411
+ "Taylor Brown (Stakeholder Representative)\n",
412
+ "\n",
413
+ "Meeting Summary:\n",
414
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
415
+ " \n",
416
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
417
+ " \n",
418
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
419
+ " \n",
420
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
421
+ " \n",
422
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
423
+ " \n",
424
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
425
+ " \n",
426
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
427
+ " \n",
428
+ "Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.\n",
429
+ " \n",
430
+ "Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.\n",
431
+ " \n",
432
+ "Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.\n",
433
+ " \n",
434
+ "Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.\n",
435
+ " \n",
436
+ "Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.\n",
437
+ " \n",
438
+ "Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.\n",
439
+ " \n",
440
+ "Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.\n",
441
+ " \n",
442
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
443
+ " \n",
444
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
445
+ " \n",
446
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
447
+ "\n",
448
+ "\u001b[00m\n",
449
+ "\u001b[32;1m\u001b[1;3mFinal Answer: \n",
450
+ "\n",
451
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
452
+ " \n",
453
+ "Date: June 7, 2024\n",
454
+ "Time: 9:00 AM to 12:00 PM\n",
455
+ "Location: Conference Room B\n",
456
+ "Attendees:\n",
457
+ " \n",
458
+ "Alex Johnson (Project Manager)\n",
459
+ "Sam Lee (Business Analyst)\n",
460
+ "Jessica Davis (Technical Lead) \n",
461
+ "Chris Smith (Quality Assurance Manager)\n",
462
+ "Taylor Brown (Stakeholder Representative)\n",
463
+ "\n",
464
+ "Meeting Summary:\n",
465
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
466
+ " \n",
467
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
468
+ " \n",
469
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
470
+ " \n",
471
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
472
+ " \n",
473
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
474
+ " \n",
475
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
476
+ " \n",
477
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
478
+ " \n",
479
+ "Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.\n",
480
+ " \n",
481
+ "Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.\n",
482
+ " \n",
483
+ "Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.\n",
484
+ " \n",
485
+ "Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.\n",
486
+ " \n",
487
+ "Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.\n",
488
+ " \n",
489
+ "Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.\n",
490
+ " \n",
491
+ "Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.\n",
492
+ " \n",
493
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
494
+ " \n",
495
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
496
+ " \n",
497
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\u001b[0m\n",
498
+ "\n",
499
+ "\u001b[1m> Finished chain.\u001b[0m\n",
500
+ "\u001b[95m \n",
501
+ "\n",
502
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
503
+ " \n",
504
+ "Date: June 7, 2024\n",
505
+ "Time: 9:00 AM to 12:00 PM\n",
506
+ "Location: Conference Room B\n",
507
+ "Attendees:\n",
508
+ " \n",
509
+ "Alex Johnson (Project Manager)\n",
510
+ "Sam Lee (Business Analyst)\n",
511
+ "Jessica Davis (Technical Lead) \n",
512
+ "Chris Smith (Quality Assurance Manager)\n",
513
+ "Taylor Brown (Stakeholder Representative)\n",
514
+ "\n",
515
+ "Meeting Summary:\n",
516
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
517
+ " \n",
518
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
519
+ " \n",
520
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
521
+ " \n",
522
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
523
+ " \n",
524
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
525
+ " \n",
526
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
527
+ " \n",
528
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
529
+ " \n",
530
+ "Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.\n",
531
+ " \n",
532
+ "Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.\n",
533
+ " \n",
534
+ "Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.\n",
535
+ " \n",
536
+ "Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.\n",
537
+ " \n",
538
+ "Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.\n",
539
+ " \n",
540
+ "Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.\n",
541
+ " \n",
542
+ "Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.\n",
543
+ " \n",
544
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
545
+ " \n",
546
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
547
+ " \n",
548
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
549
+ "\u001b[00m\n"
550
+ ]
551
+ },
552
+ {
553
+ "name": "stdout",
554
+ "output_type": "stream",
555
+ "text": [
556
+ "\u001b[32;1m\u001b[1;3mFinal Answer: \n",
557
+ "{\n",
558
+ " \"Meeting Transcript\": {\n",
559
+ " \"Meeting Details\": {\n",
560
+ " \"Date\": \"June 7, 2024\",\n",
561
+ " \"Time\": \"9:00 AM to 12:00 PM\",\n",
562
+ " \"Location\": \"Conference Room B\",\n",
563
+ " \"Attendees\": [\n",
564
+ " \"Alex Johnson (Project Manager)\",\n",
565
+ " \"Sam Lee (Business Analyst)\",\n",
566
+ " \"Jessica Davis (Technical Lead)\",\n",
567
+ " \"Chris Smith (Quality Assurance Manager)\",\n",
568
+ " \"Taylor Brown (Stakeholder Representative)\"\n",
569
+ " ]\n",
570
+ " },\n",
571
+ " \"Meeting Summary\": [\n",
572
+ " {\n",
573
+ " \"Speaker\": \"Alex Johnson (Project Manager)\",\n",
574
+ " \"Summary\": \"Primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights. Aim to realize a return on investment within one year post-implementation.\"\n",
575
+ " },\n",
576
+ " {\n",
577
+ " \"Speaker\": \"Taylor Brown (Stakeholder Representative)\",\n",
578
+ " \"Summary\": \"Boost customer engagement and satisfaction. Quantified by target increase in daily active users and a reduction in customer complaints.\"\n",
579
+ " },\n",
580
+ " {\n",
581
+ " \"Speaker\": \"Jessica Davis (Technical Lead)\",\n",
582
+ " \"Summary\": \"Substantial updates to data processing infrastructure, possibly migrating services to a more scalable cloud solution. Identify all stakeholders and understand their interests and influence on the project.\"\n",
583
+ " },\n",
584
+ " {\n",
585
+ " \"Speaker\": \"Sam Lee (Business Analyst)\",\n",
586
+ " \"Summary\": \"Define project scope meticulously. Include compliance with data protection regulations and ensure system is future-proofed. Expand success criteria to include user acceptance testing results.\"\n",
587
+ " },\n",
588
+ " {\n",
589
+ " \"Speaker\": \"Chris Smith (Quality Assurance Manager)\",\n",
590
+ " \"Summary\": \"Establish benchmarks for success criteria. Address time constraints and technical debt in current system. Quality assurance focus on ongoing monitoring during development.\"\n",
591
+ " },\n",
592
+ " {\n",
593
+ " \"Speaker\": \"Taylor Brown (Stakeholder Representative)\",\n",
594
+ " \"Summary\": \"Gather requirements through detailed discussions with stakeholder groups. Include robust backend support for handling increased data flows and advanced analytics features for customer segmentation.\"\n",
595
+ " },\n",
596
+ " {\n",
597
+ " \"Speaker\": \"Jessica Davis (Technical Lead)\",\n",
598
+ " \"Summary\": \"Mitigate risks such as data breaches and project delays. Implement stringent security measures and use agile project management techniques. Consider future expansions in system capabilities.\"\n",
599
+ " },\n",
600
+ " {\n",
601
+ " \"Speaker\": \"Sam Lee (Business Analyst)\",\n",
602
+ " \"Summary\": \"Clear lines of communication among project teams and stakeholders. Regular updates scheduled to discuss progress, challenges, and any shifts in scope or strategy.\"\n",
603
+ " },\n",
604
+ " {\n",
605
+ " \"Speaker\": \"Chris Smith (Quality Assurance Manager)\",\n",
606
+ " \"Summary\": \"Use automated and manual testing strategies to ensure all features meet strict criteria. Focus on ongoing monitoring during development.\"\n",
607
+ " },\n",
608
+ " {\n",
609
+ " \"Speaker\": \"Jessica Davis (Technical Lead)\",\n",
610
+ " \"Summary\": \"Consider modular capabilities for future expansions. Build in new features as customer needs evolve without major disruptions to existing system.\"\n",
611
+ " },\n",
612
+ " {\n",
613
+ " \"Speaker\": \"Taylor Brown (Stakeholder Representative)\",\n",
614
+ " \"Summary\": \"Detailed cost-benefit analysis post-implementation. Measure project's impact on ROI targets, customer metrics, and overall business operations.\"\n",
615
+ " },\n",
616
+ " {\n",
617
+ " \"Speaker\": \"Alex Johnson (Project Manager)\",\n",
618
+ " \"Summary\": \"Draft a comprehensive project plan with timelines, budgeting, and resource allocation based on today’s discussion. Aim to have it ready by next week’s meeting.\"\n",
619
+ " }\n",
620
+ " ]\n",
621
+ " }\n",
622
+ "}\u001b[0m\n",
623
+ "\n",
624
+ "\u001b[1m> Finished chain.\u001b[0m\n",
625
+ "\u001b[1m\u001b[92m [DEBUG]: == [Text Interpreter] Task output: {\n",
626
+ " \"Meeting Transcript\": {\n",
627
+ " \"Meeting Details\": {\n",
628
+ " \"Date\": \"June 7, 2024\",\n",
629
+ " \"Time\": \"9:00 AM to 12:00 PM\",\n",
630
+ " \"Location\": \"Conference Room B\",\n",
631
+ " \"Attendees\": [\n",
632
+ " \"Alex Johnson (Project Manager)\",\n",
633
+ " \"Sam Lee (Business Analyst)\",\n",
634
+ " \"Jessica Davis (Technical Lead)\",\n",
635
+ " \"Chris Smith (Quality Assurance Manager)\",\n",
636
+ " \"Taylor Brown (Stakeholder Representative)\"\n",
637
+ " ]\n",
638
+ " },\n",
639
+ " \"Meeting Summary\": [\n",
640
+ " {\n",
641
+ " \"Speaker\": \"Alex Johnson (Project Manager)\",\n",
642
+ " \"Summary\": \"Primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights. Aim to realize a return on investment within one year post-implementation.\"\n",
643
+ " },\n",
644
+ " {\n",
645
+ " \"Speaker\": \"Taylor Brown (Stakeholder Representative)\",\n",
646
+ " \"Summary\": \"Boost customer engagement and satisfaction. Quantified by target increase in daily active users and a reduction in customer complaints.\"\n",
647
+ " },\n",
648
+ " {\n",
649
+ " \"Speaker\": \"Jessica Davis (Technical Lead)\",\n",
650
+ " \"Summary\": \"Substantial updates to data processing infrastructure, possibly migrating services to a more scalable cloud solution. Identify all stakeholders and understand their interests and influence on the project.\"\n",
651
+ " },\n",
652
+ " {\n",
653
+ " \"Speaker\": \"Sam Lee (Business Analyst)\",\n",
654
+ " \"Summary\": \"Define project scope meticulously. Include compliance with data protection regulations and ensure system is future-proofed. Expand success criteria to include user acceptance testing results.\"\n",
655
+ " },\n",
656
+ " {\n",
657
+ " \"Speaker\": \"Chris Smith (Quality Assurance Manager)\",\n",
658
+ " \"Summary\": \"Establish benchmarks for success criteria. Address time constraints and technical debt in current system. Quality assurance focus on ongoing monitoring during development.\"\n",
659
+ " },\n",
660
+ " {\n",
661
+ " \"Speaker\": \"Taylor Brown (Stakeholder Representative)\",\n",
662
+ " \"Summary\": \"Gather requirements through detailed discussions with stakeholder groups. Include robust backend support for handling increased data flows and advanced analytics features for customer segmentation.\"\n",
663
+ " },\n",
664
+ " {\n",
665
+ " \"Speaker\": \"Jessica Davis (Technical Lead)\",\n",
666
+ " \"Summary\": \"Mitigate risks such as data breaches and project delays. Implement stringent security measures and use agile project management techniques. Consider future expansions in system capabilities.\"\n",
667
+ " },\n",
668
+ " {\n",
669
+ " \"Speaker\": \"Sam Lee (Business Analyst)\",\n",
670
+ " \"Summary\": \"Clear lines of communication among project teams and stakeholders. Regular updates scheduled to discuss progress, challenges, and any shifts in scope or strategy.\"\n",
671
+ " },\n",
672
+ " {\n",
673
+ " \"Speaker\": \"Chris Smith (Quality Assurance Manager)\",\n",
674
+ " \"Summary\": \"Use automated and manual testing strategies to ensure all features meet strict criteria. Focus on ongoing monitoring during development.\"\n",
675
+ " },\n",
676
+ " {\n",
677
+ " \"Speaker\": \"Jessica Davis (Technical Lead)\",\n",
678
+ " \"Summary\": \"Consider modular capabilities for future expansions. Build in new features as customer needs evolve without major disruptions to existing system.\"\n",
679
+ " },\n",
680
+ " {\n",
681
+ " \"Speaker\": \"Taylor Brown (Stakeholder Representative)\",\n",
682
+ " \"Summary\": \"Detailed cost-benefit analysis post-implementation. Measure project's impact on ROI targets, customer metrics, and overall business operations.\"\n",
683
+ " },\n",
684
+ " {\n",
685
+ " \"Speaker\": \"Alex Johnson (Project Manager)\",\n",
686
+ " \"Summary\": \"Draft a comprehensive project plan with timelines, budgeting, and resource allocation based on today’s discussion. Aim to have it ready by next week’s meeting.\"\n",
687
+ " }\n",
688
+ " ]\n",
689
+ " }\n",
690
+ "}\n",
691
+ "\n",
692
+ "\u001b[00m\n",
693
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: Data Extraction Agent\u001b[00m\n",
694
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Take the JSON structured data from the Text Parsing Agent.\n",
695
+ "2. Identify and extract specific data points like project goals, technical requirements,and stakeholder information.\n",
696
+ "3. Organize the extracted data into relevant categories for easy access and use.\n",
697
+ "4. Format all extracted data into a structured form suitable for document generation,ensuring it's ready for template insertion.\n",
698
+ "\u001b[00m\n",
699
+ "\n",
700
+ "\n",
701
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
702
+ "\u001b[32;1m\u001b[1;3mI need to extract specific data points like project goals, technical requirements, and stakeholder information from the Meeting Transcript provided.\n",
703
+ "\n",
704
+ "Action: Read a file's content\n",
705
+ "Action Input: {\"file_path\": \"./meeting-transcription/meeting-transcript.txt\"}\u001b[0m\u001b[95m \n",
706
+ "\n",
707
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
708
+ " \n",
709
+ "Date: June 7, 2024\n",
710
+ "Time: 9:00 AM to 12:00 PM\n",
711
+ "Location: Conference Room B\n",
712
+ "Attendees:\n",
713
+ " \n",
714
+ "Alex Johnson (Project Manager)\n",
715
+ "Sam Lee (Business Analyst)\n",
716
+ "Jessica Davis (Technical Lead) \n",
717
+ "Chris Smith (Quality Assurance Manager)\n",
718
+ "Taylor Brown (Stakeholder Representative)\n",
719
+ "\n",
720
+ "Meeting Summary:\n",
721
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
722
+ " \n",
723
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
724
+ " \n",
725
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
726
+ " \n",
727
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
728
+ " \n",
729
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
730
+ " \n",
731
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
732
+ " \n",
733
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
734
+ " \n",
735
+ "Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.\n",
736
+ " \n",
737
+ "Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.\n",
738
+ " \n",
739
+ "Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.\n",
740
+ " \n",
741
+ "Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.\n",
742
+ " \n",
743
+ "Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.\n",
744
+ " \n",
745
+ "Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.\n",
746
+ " \n",
747
+ "Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.\n",
748
+ " \n",
749
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
750
+ " \n",
751
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
752
+ " \n",
753
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
754
+ "\n",
755
+ "\u001b[00m\n"
756
+ ]
757
+ },
758
+ {
759
+ "name": "stdout",
760
+ "output_type": "stream",
761
+ "text": [
762
+ "\u001b[32;1m\u001b[1;3mFinal Answer: \n",
763
+ "Project Goals:\n",
764
+ "- Integrate advanced analytics into the platform to enhance user experience and provide robust data insights.\n",
765
+ "- Realize a return on investment within one year post-implementation.\n",
766
+ "- Increase revenue through enhanced data-driven marketing strategies and reduce operational costs via more efficient data handling processes.\n",
767
+ "\n",
768
+ "Technical Requirements:\n",
769
+ "- Substantial updates to data processing infrastructure, possibly migrating services to a more scalable cloud solution.\n",
770
+ "- Establish benchmarks for success criteria, including decreasing load times by 30% and achieving an error rate below 0.1%.\n",
771
+ "- Implement stringent security measures to mitigate risks such as data breaches and project delays.\n",
772
+ "- Build in modular capabilities for future expansions.\n",
773
+ "- Use both automated and manual testing strategies to ensure all features meet strict criteria.\n",
774
+ "\n",
775
+ "Stakeholder Information:\n",
776
+ "- Identify and understand interests and influence of all stakeholders.\n",
777
+ "- Gather requirements through detailed discussions with stakeholder groups.\n",
778
+ "- Provide robust backend support for handling increased data flows and advanced analytics features for customer segmentation.\n",
779
+ "- Conduct a detailed cost-benefit analysis post-implementation to measure project impact on ROI targets, customer metrics, and overall business operations.\u001b[0m\n",
780
+ "\n",
781
+ "\u001b[1m> Finished chain.\u001b[0m\n",
782
+ "\u001b[1m\u001b[92m [DEBUG]: == [Data Extraction Agent] Task output: Project Goals:\n",
783
+ "- Integrate advanced analytics into the platform to enhance user experience and provide robust data insights.\n",
784
+ "- Realize a return on investment within one year post-implementation.\n",
785
+ "- Increase revenue through enhanced data-driven marketing strategies and reduce operational costs via more efficient data handling processes.\n",
786
+ "\n",
787
+ "Technical Requirements:\n",
788
+ "- Substantial updates to data processing infrastructure, possibly migrating services to a more scalable cloud solution.\n",
789
+ "- Establish benchmarks for success criteria, including decreasing load times by 30% and achieving an error rate below 0.1%.\n",
790
+ "- Implement stringent security measures to mitigate risks such as data breaches and project delays.\n",
791
+ "- Build in modular capabilities for future expansions.\n",
792
+ "- Use both automated and manual testing strategies to ensure all features meet strict criteria.\n",
793
+ "\n",
794
+ "Stakeholder Information:\n",
795
+ "- Identify and understand interests and influence of all stakeholders.\n",
796
+ "- Gather requirements through detailed discussions with stakeholder groups.\n",
797
+ "- Provide robust backend support for handling increased data flows and advanced analytics features for customer segmentation.\n",
798
+ "- Conduct a detailed cost-benefit analysis post-implementation to measure project impact on ROI targets, customer metrics, and overall business operations.\n",
799
+ "\n",
800
+ "\u001b[00m\n",
801
+ "\u001b[1m\u001b[95m [DEBUG]: == Working Agent: BRD Compiler\u001b[00m\n",
802
+ "\u001b[1m\u001b[95m [INFO]: == Starting Task: 1. Accept the structured and categorized data from the Data Extraction Agent.\n",
803
+ "2. Open and read the BRD template for data insertion.\n",
804
+ "3. Insert the received data into the respective sections of the BRD template.\n",
805
+ "4. Apply formatting rules to ensure the document is professional and adheres to standards.\n",
806
+ "5. Save the populated and formatted document as a new markdown file, marking the task as complete.\n",
807
+ "\u001b[00m\n",
808
+ "\n",
809
+ "\n",
810
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
811
+ "\u001b[32;1m\u001b[1;3mI need to start by accepting the structured and categorized data from the Data Extraction Agent.\n",
812
+ "\n",
813
+ "Action: Delegate work to co-worker\n",
814
+ "Action Input: {\"coworker\": \"Data Extraction Agent\", \"task\": \"Provide structured and categorized data\", \"context\": \"I need the structured and categorized data extracted from the project documentation for insertion into the BRD template.\"}\u001b[0m\n",
815
+ "\n",
816
+ "\u001b[1m> Entering new CrewAgentExecutor chain...\u001b[0m\n",
817
+ "\u001b[32;1m\u001b[1;3mI need to start by reading the content of the project documentation files to extract the necessary structured and categorized data for the BRD template.\n",
818
+ "\n",
819
+ "Action: Read a file's content\n",
820
+ "Action Input: {\"file_path\": \"./meeting-transcription/meeting-transcript.txt\"}\u001b[0m\u001b[95m \n",
821
+ "\n",
822
+ "Meeting Transcript: Extensive IT Project Requirements Discussion\n",
823
+ " \n",
824
+ "Date: June 7, 2024\n",
825
+ "Time: 9:00 AM to 12:00 PM\n",
826
+ "Location: Conference Room B\n",
827
+ "Attendees:\n",
828
+ " \n",
829
+ "Alex Johnson (Project Manager)\n",
830
+ "Sam Lee (Business Analyst)\n",
831
+ "Jessica Davis (Technical Lead) \n",
832
+ "Chris Smith (Quality Assurance Manager)\n",
833
+ "Taylor Brown (Stakeholder Representative)\n",
834
+ "\n",
835
+ "Meeting Summary:\n",
836
+ "Alex Johnson (Project Manager): Good morning, everyone. Let's start today’s extensive session by clearly defining our project goals. The primary goal is to integrate advanced analytics into our platform, enhancing user experience and providing robust data insights.\n",
837
+ " \n",
838
+ "Taylor Brown (Stakeholder Representative): In alignment with Alex’s point, our business needs are clear. We need to boost customer engagement and satisfaction. This can be quantified by a target increase in daily active users and a reduction in customer complaints.\n",
839
+ " \n",
840
+ "Jessica Davis (Technical Lead): From a technical perspective, integrating these analytics will involve substantial updates to our data processing infrastructure and possibly migrating some services to a more scalable cloud solution.\n",
841
+ " \n",
842
+ "Sam Lee (Business Analyst): Given the complexity, we need to define the scope meticulously. This includes not only the technical implementation but also compliance with data protection regulations and ensuring our system is future-proofed for further upgrades.\n",
843
+ " \n",
844
+ "Chris Smith (Quality Assurance Manager): As for success criteria, we need to establish benchmarks. This means setting specific performance targets, like decreasing load times by 30% and achieving an error rate below 0.1%.\n",
845
+ " \n",
846
+ "Alex Johnson (Project Manager): Moving forward with our business objectives, we should aim to realize a return on investment within one year post-implementation, by increasing revenue through enhanced data-driven marketing strategies and reducing operational costs via more efficient data handling processes.\n",
847
+ " \n",
848
+ "Jessica Davis (Technical Lead): Identifying all stakeholders is key. We have internal stakeholders such as our IT and customer service teams, and external ones including technology partners and end-users. We must understand their interests and influence on the project.\n",
849
+ " \n",
850
+ "Taylor Brown (Stakeholder Representative): Gathering requirements will involve detailed discussions with each stakeholder group. For example, our IT team needs robust backend support for handling increased data flows, while our marketing team requires advanced analytics features for customer segmentation.\n",
851
+ " \n",
852
+ "Sam Lee (Business Analyst): The success criteria need to be expanded to include user acceptance testing results, with at least 90% positive feedback on usability and functionality from initial user groups.\n",
853
+ " \n",
854
+ "Chris Smith (Quality Assurance Manager): Addressing constraints, our primary issues are time, as Alex mentioned, and technical debt in our current system which could delay integration efforts. We must allocate resources effectively and perhaps consider additional staffing or outsourcing certain developments.\n",
855
+ " \n",
856
+ "Jessica Davis (Technical Lead): In terms of risks, we face several, including potential data breaches and project delays. Our risk mitigation strategy will involve implementing stringent security measures from the outset and using agile project management techniques to allow for flexibility and rapid response to any issues that arise.\n",
857
+ " \n",
858
+ "Alex Johnson (Project Manager): To elaborate on project scope, we’re looking at three major components: upgrading our database architecture, developing new analytics functionalities, and implementing user interface enhancements to display these analytics effectively.\n",
859
+ " \n",
860
+ "Sam Lee (Business Analyst): It’s also essential to establish clear lines of communication among all project teams and stakeholders. Regular updates, perhaps bi-weekly, should be scheduled to discuss progress, challenges, and any shifts in scope or strategy.\n",
861
+ " \n",
862
+ "Chris Smith (Quality Assurance Manager): Quality assurance will not just focus on post-development testing but also on ongoing monitoring during development. We’ll use both automated and manual testing strategies to ensure all features meet our strict criteria before full-scale launch.\n",
863
+ " \n",
864
+ "Jessica Davis (Technical Lead): Technically, we should consider the possibility of future expansions. This means building in modular capabilities so new features can be added as customer needs evolve without major disruptions to the existing system.\n",
865
+ " \n",
866
+ "Taylor Brown (Stakeholder Representative): Finally, from a business perspective, we need a detailed cost-benefit analysis post-implementation to measure whether the project has met its ROI targets and how it has impacted customer metrics and overall business operations.\n",
867
+ " \n",
868
+ "Alex Johnson (Project Manager): With all these points in detail, our next steps are to draft a comprehensive project plan that includes timelines, budgeting, and resource allocation based on today’s discussion. Let’s aim to have that ready by next week’s meeting.\n",
869
+ "\n",
870
+ "\u001b[00m\n"
871
+ ]
872
+ },
873
+ {
874
+ "name": "stdout",
875
+ "output_type": "stream",
876
+ "text": [
877
+ "\u001b[32;1m\u001b[1;3mFinal Answer: \n",
878
+ "\n",
879
+ "Structured and categorized data extracted from the project documentation for insertion into the BRD template:\n",
880
+ "\n",
881
+ "**Project Goals:**\n",
882
+ "- Integrate advanced analytics into the platform for enhancing user experience and providing robust data insights.\n",
883
+ "- Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
884
+ "\n",
885
+ "**Technical Requirements:**\n",
886
+ "- Substantial updates to data processing infrastructure.\n",
887
+ "- Possible migration of services to a more scalable cloud solution.\n",
888
+ "- Building modular capabilities for future expansions without disruptions.\n",
889
+ "\n",
890
+ "**Scope:**\n",
891
+ "- Define scope meticulously, including technical implementation, compliance with data protection regulations, and future-proofing for upgrades.\n",
892
+ "- Upgrade database architecture, develop new analytics functionalities, and implement user interface enhancements.\n",
893
+ "\n",
894
+ "**Success Criteria:**\n",
895
+ "- Decrease load times by 30%.\n",
896
+ "- Achieve an error rate below 0.1%.\n",
897
+ "- Establish benchmarks for performance targets.\n",
898
+ "- Realize a return on investment within one year post-implementation.\n",
899
+ "- User acceptance testing results with at least 90% positive feedback on usability and functionality.\n",
900
+ "\n",
901
+ "**Stakeholders:**\n",
902
+ "- Internal stakeholders: IT team, customer service team.\n",
903
+ "- External stakeholders: Technology partners, end-users.\n",
904
+ "- Detailed discussions with each stakeholder group to gather requirements and understand interests.\n",
905
+ "\n",
906
+ "**Constraints:**\n",
907
+ "- Time constraints.\n",
908
+ "- Technical debt in the current system.\n",
909
+ "- Allocate resources effectively, consider additional staffing or outsourcing developments.\n",
910
+ "\n",
911
+ "**Risks:**\n",
912
+ "- Potential data breaches.\n",
913
+ "- Project delays.\n",
914
+ "- Risk mitigation strategy: Implement stringent security measures from the outset, use agile project management techniques.\n",
915
+ "\n",
916
+ "**Communication:**\n",
917
+ "- Establish clear lines of communication among all project teams and stakeholders.\n",
918
+ "- Regular updates schedule, bi-weekly, to discuss progress, challenges, and scope changes.\n",
919
+ "\n",
920
+ "**Quality Assurance:**\n",
921
+ "- Focus on ongoing monitoring during development.\n",
922
+ "- Use automated and manual testing strategies to ensure all features meet strict criteria before launch.\n",
923
+ "\n",
924
+ "**Business Perspective:**\n",
925
+ "- Detailed cost-benefit analysis post-implementation.\n",
926
+ "- Measure project impact on ROI targets, customer metrics, and business operations.\n",
927
+ "\n",
928
+ "**Next Steps:**\n",
929
+ "- Draft a comprehensive project plan including timelines, budgeting, and resource allocation based on the discussion. Aim to have it ready by next week's meeting.\u001b[0m\n",
930
+ "\n",
931
+ "\u001b[1m> Finished chain.\u001b[0m\n",
932
+ "\u001b[95m \n",
933
+ "\n",
934
+ "Structured and categorized data extracted from the project documentation for insertion into the BRD template:\n",
935
+ "\n",
936
+ "**Project Goals:**\n",
937
+ "- Integrate advanced analytics into the platform for enhancing user experience and providing robust data insights.\n",
938
+ "- Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
939
+ "\n",
940
+ "**Technical Requirements:**\n",
941
+ "- Substantial updates to data processing infrastructure.\n",
942
+ "- Possible migration of services to a more scalable cloud solution.\n",
943
+ "- Building modular capabilities for future expansions without disruptions.\n",
944
+ "\n",
945
+ "**Scope:**\n",
946
+ "- Define scope meticulously, including technical implementation, compliance with data protection regulations, and future-proofing for upgrades.\n",
947
+ "- Upgrade database architecture, develop new analytics functionalities, and implement user interface enhancements.\n",
948
+ "\n",
949
+ "**Success Criteria:**\n",
950
+ "- Decrease load times by 30%.\n",
951
+ "- Achieve an error rate below 0.1%.\n",
952
+ "- Establish benchmarks for performance targets.\n",
953
+ "- Realize a return on investment within one year post-implementation.\n",
954
+ "- User acceptance testing results with at least 90% positive feedback on usability and functionality.\n",
955
+ "\n",
956
+ "**Stakeholders:**\n",
957
+ "- Internal stakeholders: IT team, customer service team.\n",
958
+ "- External stakeholders: Technology partners, end-users.\n",
959
+ "- Detailed discussions with each stakeholder group to gather requirements and understand interests.\n",
960
+ "\n",
961
+ "**Constraints:**\n",
962
+ "- Time constraints.\n",
963
+ "- Technical debt in the current system.\n",
964
+ "- Allocate resources effectively, consider additional staffing or outsourcing developments.\n",
965
+ "\n",
966
+ "**Risks:**\n",
967
+ "- Potential data breaches.\n",
968
+ "- Project delays.\n",
969
+ "- Risk mitigation strategy: Implement stringent security measures from the outset, use agile project management techniques.\n",
970
+ "\n",
971
+ "**Communication:**\n",
972
+ "- Establish clear lines of communication among all project teams and stakeholders.\n",
973
+ "- Regular updates schedule, bi-weekly, to discuss progress, challenges, and scope changes.\n",
974
+ "\n",
975
+ "**Quality Assurance:**\n",
976
+ "- Focus on ongoing monitoring during development.\n",
977
+ "- Use automated and manual testing strategies to ensure all features meet strict criteria before launch.\n",
978
+ "\n",
979
+ "**Business Perspective:**\n",
980
+ "- Detailed cost-benefit analysis post-implementation.\n",
981
+ "- Measure project impact on ROI targets, customer metrics, and business operations.\n",
982
+ "\n",
983
+ "**Next Steps:**\n",
984
+ "- Draft a comprehensive project plan including timelines, budgeting, and resource allocation based on the discussion. Aim to have it ready by next week's meeting.\n",
985
+ "\u001b[00m\n",
986
+ "\u001b[32;1m\u001b[1;3mFinal Answer:\n",
987
+ "\n",
988
+ "# Business Requirements Document\n",
989
+ "\n",
990
+ "## Project Goals:\n",
991
+ "- Integrate advanced analytics into the platform for enhancing user experience and providing robust data insights.\n",
992
+ "- Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
993
+ "\n",
994
+ "## Technical Requirements:\n",
995
+ "- Substantial updates to data processing infrastructure.\n",
996
+ "- Possible migration of services to a more scalable cloud solution.\n",
997
+ "- Building modular capabilities for future expansions without disruptions.\n",
998
+ "\n",
999
+ "## Scope:\n",
1000
+ "- Define scope meticulously, including technical implementation, compliance with data protection regulations, and future-proofing for upgrades.\n",
1001
+ "- Upgrade database architecture, develop new analytics functionalities, and implement user interface enhancements.\n",
1002
+ "\n",
1003
+ "## Success Criteria:\n",
1004
+ "- Decrease load times by 30%.\n",
1005
+ "- Achieve an error rate below 0.1%.\n",
1006
+ "- Establish benchmarks for performance targets.\n",
1007
+ "- Realize a return on investment within one year post-implementation.\n",
1008
+ "- User acceptance testing results with at least 90% positive feedback on usability and functionality.\n",
1009
+ "\n",
1010
+ "## Stakeholders:\n",
1011
+ "- Internal stakeholders: IT team, customer service team.\n",
1012
+ "- External stakeholders: Technology partners, end-users.\n",
1013
+ "- Detailed discussions with each stakeholder group to gather requirements and understand interests.\n",
1014
+ "\n",
1015
+ "## Constraints:\n",
1016
+ "- Time constraints.\n",
1017
+ "- Technical debt in the current system.\n",
1018
+ "- Allocate resources effectively, consider additional staffing or outsourcing developments.\n",
1019
+ "\n",
1020
+ "## Risks:\n",
1021
+ "- Potential data breaches.\n",
1022
+ "- Project delays.\n",
1023
+ "- Risk mitigation strategy: Implement stringent security measures from the outset, use agile project management techniques.\n",
1024
+ "\n",
1025
+ "## Communication:\n",
1026
+ "- Establish clear lines of communication among all project teams and stakeholders.\n",
1027
+ "- Regular updates schedule, bi-weekly, to discuss progress, challenges, and scope changes.\n",
1028
+ "\n",
1029
+ "## Quality Assurance:\n",
1030
+ "- Focus on ongoing monitoring during development.\n",
1031
+ "- Use automated and manual testing strategies to ensure all features meet strict criteria before launch.\n",
1032
+ "\n",
1033
+ "## Business Perspective:\n",
1034
+ "- Detailed cost-benefit analysis post-implementation.\n",
1035
+ "- Measure project impact on ROI targets, customer metrics, and business operations.\n",
1036
+ "\n",
1037
+ "## Next Steps:\n",
1038
+ "- Draft a comprehensive project plan including timelines, budgeting, and resource allocation based on the discussion. Aim to have it ready by next week's meeting.\u001b[0m\n",
1039
+ "\n",
1040
+ "\u001b[1m> Finished chain.\u001b[0m\n",
1041
+ "\u001b[1m\u001b[92m [DEBUG]: == [BRD Compiler] Task output: # Business Requirements Document\n",
1042
+ "\n",
1043
+ "## Project Goals:\n",
1044
+ "- Integrate advanced analytics into the platform for enhancing user experience and providing robust data insights.\n",
1045
+ "- Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
1046
+ "\n",
1047
+ "## Technical Requirements:\n",
1048
+ "- Substantial updates to data processing infrastructure.\n",
1049
+ "- Possible migration of services to a more scalable cloud solution.\n",
1050
+ "- Building modular capabilities for future expansions without disruptions.\n",
1051
+ "\n",
1052
+ "## Scope:\n",
1053
+ "- Define scope meticulously, including technical implementation, compliance with data protection regulations, and future-proofing for upgrades.\n",
1054
+ "- Upgrade database architecture, develop new analytics functionalities, and implement user interface enhancements.\n",
1055
+ "\n",
1056
+ "## Success Criteria:\n",
1057
+ "- Decrease load times by 30%.\n",
1058
+ "- Achieve an error rate below 0.1%.\n",
1059
+ "- Establish benchmarks for performance targets.\n",
1060
+ "- Realize a return on investment within one year post-implementation.\n",
1061
+ "- User acceptance testing results with at least 90% positive feedback on usability and functionality.\n",
1062
+ "\n",
1063
+ "## Stakeholders:\n",
1064
+ "- Internal stakeholders: IT team, customer service team.\n",
1065
+ "- External stakeholders: Technology partners, end-users.\n",
1066
+ "- Detailed discussions with each stakeholder group to gather requirements and understand interests.\n",
1067
+ "\n",
1068
+ "## Constraints:\n",
1069
+ "- Time constraints.\n",
1070
+ "- Technical debt in the current system.\n",
1071
+ "- Allocate resources effectively, consider additional staffing or outsourcing developments.\n",
1072
+ "\n",
1073
+ "## Risks:\n",
1074
+ "- Potential data breaches.\n",
1075
+ "- Project delays.\n",
1076
+ "- Risk mitigation strategy: Implement stringent security measures from the outset, use agile project management techniques.\n",
1077
+ "\n",
1078
+ "## Communication:\n",
1079
+ "- Establish clear lines of communication among all project teams and stakeholders.\n",
1080
+ "- Regular updates schedule, bi-weekly, to discuss progress, challenges, and scope changes.\n",
1081
+ "\n",
1082
+ "## Quality Assurance:\n",
1083
+ "- Focus on ongoing monitoring during development.\n",
1084
+ "- Use automated and manual testing strategies to ensure all features meet strict criteria before launch.\n",
1085
+ "\n",
1086
+ "## Business Perspective:\n",
1087
+ "- Detailed cost-benefit analysis post-implementation.\n",
1088
+ "- Measure project impact on ROI targets, customer metrics, and business operations.\n",
1089
+ "\n",
1090
+ "## Next Steps:\n",
1091
+ "- Draft a comprehensive project plan including timelines, budgeting, and resource allocation based on the discussion. Aim to have it ready by next week's meeting.\n",
1092
+ "\n",
1093
+ "\u001b[00m\n"
1094
+ ]
1095
+ }
1096
+ ],
1097
+ "source": [
1098
+ "\n",
1099
+ "\n",
1100
+ "result = crew.kickoff(inputs={})"
1101
+ ]
1102
+ },
1103
+ {
1104
+ "cell_type": "markdown",
1105
+ "metadata": {},
1106
+ "source": [
1107
+ "- Display the results of your execution as markdown in the notebook."
1108
+ ]
1109
+ },
1110
+ {
1111
+ "cell_type": "code",
1112
+ "execution_count": 13,
1113
+ "metadata": {
1114
+ "height": 47
1115
+ },
1116
+ "outputs": [
1117
+ {
1118
+ "data": {
1119
+ "text/markdown": [
1120
+ "# Business Requirements Document\n",
1121
+ "\n",
1122
+ "## Project Goals:\n",
1123
+ "- Integrate advanced analytics into the platform for enhancing user experience and providing robust data insights.\n",
1124
+ "- Boost customer engagement and satisfaction by increasing daily active users and reducing customer complaints.\n",
1125
+ "\n",
1126
+ "## Technical Requirements:\n",
1127
+ "- Substantial updates to data processing infrastructure.\n",
1128
+ "- Possible migration of services to a more scalable cloud solution.\n",
1129
+ "- Building modular capabilities for future expansions without disruptions.\n",
1130
+ "\n",
1131
+ "## Scope:\n",
1132
+ "- Define scope meticulously, including technical implementation, compliance with data protection regulations, and future-proofing for upgrades.\n",
1133
+ "- Upgrade database architecture, develop new analytics functionalities, and implement user interface enhancements.\n",
1134
+ "\n",
1135
+ "## Success Criteria:\n",
1136
+ "- Decrease load times by 30%.\n",
1137
+ "- Achieve an error rate below 0.1%.\n",
1138
+ "- Establish benchmarks for performance targets.\n",
1139
+ "- Realize a return on investment within one year post-implementation.\n",
1140
+ "- User acceptance testing results with at least 90% positive feedback on usability and functionality.\n",
1141
+ "\n",
1142
+ "## Stakeholders:\n",
1143
+ "- Internal stakeholders: IT team, customer service team.\n",
1144
+ "- External stakeholders: Technology partners, end-users.\n",
1145
+ "- Detailed discussions with each stakeholder group to gather requirements and understand interests.\n",
1146
+ "\n",
1147
+ "## Constraints:\n",
1148
+ "- Time constraints.\n",
1149
+ "- Technical debt in the current system.\n",
1150
+ "- Allocate resources effectively, consider additional staffing or outsourcing developments.\n",
1151
+ "\n",
1152
+ "## Risks:\n",
1153
+ "- Potential data breaches.\n",
1154
+ "- Project delays.\n",
1155
+ "- Risk mitigation strategy: Implement stringent security measures from the outset, use agile project management techniques.\n",
1156
+ "\n",
1157
+ "## Communication:\n",
1158
+ "- Establish clear lines of communication among all project teams and stakeholders.\n",
1159
+ "- Regular updates schedule, bi-weekly, to discuss progress, challenges, and scope changes.\n",
1160
+ "\n",
1161
+ "## Quality Assurance:\n",
1162
+ "- Focus on ongoing monitoring during development.\n",
1163
+ "- Use automated and manual testing strategies to ensure all features meet strict criteria before launch.\n",
1164
+ "\n",
1165
+ "## Business Perspective:\n",
1166
+ "- Detailed cost-benefit analysis post-implementation.\n",
1167
+ "- Measure project impact on ROI targets, customer metrics, and business operations.\n",
1168
+ "\n",
1169
+ "## Next Steps:\n",
1170
+ "- Draft a comprehensive project plan including timelines, budgeting, and resource allocation based on the discussion. Aim to have it ready by next week's meeting."
1171
+ ],
1172
+ "text/plain": [
1173
+ "<IPython.core.display.Markdown object>"
1174
+ ]
1175
+ },
1176
+ "execution_count": 13,
1177
+ "metadata": {},
1178
+ "output_type": "execute_result"
1179
+ }
1180
+ ],
1181
+ "source": [
1182
+ "from IPython.display import Markdown\n",
1183
+ "Markdown(result)"
1184
+ ]
1185
+ }
1186
+ ],
1187
+ "metadata": {
1188
+ "colab": {
1189
+ "gpuType": "T4",
1190
+ "provenance": []
1191
+ },
1192
+ "kernelspec": {
1193
+ "display_name": "Python 3 (ipykernel)",
1194
+ "language": "python",
1195
+ "name": "python3"
1196
+ },
1197
+ "language_info": {
1198
+ "codemirror_mode": {
1199
+ "name": "ipython",
1200
+ "version": 3
1201
+ },
1202
+ "file_extension": ".py",
1203
+ "mimetype": "text/x-python",
1204
+ "name": "python",
1205
+ "nbconvert_exporter": "python",
1206
+ "pygments_lexer": "ipython3",
1207
+ "version": "3.11.9"
1208
+ }
1209
+ },
1210
+ "nbformat": 4,
1211
+ "nbformat_minor": 4
1212
+ }
Multi-Agent BRD Generator/utils.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Add your utilities or helper functions to this file.
2
+
3
+ import os
4
+ from dotenv import load_dotenv, find_dotenv
5
+
6
+ # these expect to find a .env file at the directory above the lesson. # the format for that file is (without the comment) #API_KEYNAME=AStringThatIsTheLongAPIKeyFromSomeService
7
+ def load_env():
8
+ _ = load_dotenv(find_dotenv())
9
+
10
+ def get_openai_api_key():
11
+ load_env()
12
+ # openai_api_key = os.getenv("OPENAI_API_KEY")
13
+ openai_api_key = "sk-proj-yB2c7FvCOjmT1aRmn4HFT3BlbkFJzWapkbcRuZuo5uo0vtMr"
14
+ return openai_api_key
15
+
16
+ def get_serper_api_key():
17
+ load_env()
18
+ openai_api_key = os.getenv("SERPER_API_KEY")
19
+ return openai_api_key
20
+
21
+
22
+ # break line every 80 characters if line is longer than 80 characters
23
+ # don't break in the middle of a word
24
+ def pretty_print_result(result):
25
+ parsed_result = []
26
+ for line in result.split('\n'):
27
+ if len(line) > 80:
28
+ words = line.split(' ')
29
+ new_line = ''
30
+ for word in words:
31
+ if len(new_line) + len(word) + 1 > 80:
32
+ parsed_result.append(new_line)
33
+ new_line = word
34
+ else:
35
+ if new_line == '':
36
+ new_line = word
37
+ else:
38
+ new_line += ' ' + word
39
+ parsed_result.append(new_line)
40
+ else:
41
+ parsed_result.append(line)
42
+ return "\n".join(parsed_result)