1
1
from typing import Iterator
2
- from pathlib import Path
3
- from shutil import rmtree
4
2
5
3
from phi .agent import Agent , RunResponse
6
4
from phi .workflow import Workflow
7
5
from phi .tools .yfinance import YFinanceTools
8
6
from phi .utils .log import logger
9
7
10
8
11
- reports_dir = Path (__file__ ).parent .joinpath ("reports" , "investment" )
12
- if reports_dir .is_dir ():
13
- rmtree (path = reports_dir , ignore_errors = True )
14
- reports_dir .mkdir (parents = True , exist_ok = True )
15
- stock_analyst_report = str (reports_dir .joinpath ("stock_analyst_report.md" ))
16
- research_analyst_report = str (reports_dir .joinpath ("research_analyst_report.md" ))
17
- investment_report = str (reports_dir .joinpath ("investment_report.md" ))
18
-
19
-
20
9
class InvestmentAnalyst (Workflow ):
21
10
description : str = (
22
11
"Produce a research report on a list of companies and then rank them based on investment potential."
@@ -32,7 +21,6 @@ class InvestmentAnalyst(Workflow):
32
21
"Note: This is only for educational purposes." ,
33
22
],
34
23
expected_output = "Report in markdown format" ,
35
- save_response_to_file = stock_analyst_report ,
36
24
)
37
25
38
26
research_analyst : Agent = Agent (
@@ -46,7 +34,6 @@ class InvestmentAnalyst(Workflow):
46
34
"Prepare a markdown report with your findings with as much detail as possible." ,
47
35
],
48
36
expected_output = "Report in markdown format" ,
49
- save_response_to_file = research_analyst_report ,
50
37
)
51
38
52
39
investment_lead : Agent = Agent (
@@ -58,7 +45,6 @@ class InvestmentAnalyst(Workflow):
58
45
"Review the report provided by the research analyst and produce a investment proposal for the client." ,
59
46
"Provide the amount you'll exist in each company and a report on why." ,
60
47
],
61
- save_response_to_file = investment_report ,
62
48
)
63
49
64
50
def run (self , companies : str ) -> Iterator [RunResponse ]:
0 commit comments