Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def financial_analysis_agent(company_name, year):
- task_plan = llm.generate(f"""
- Create a step-by-step plan to analyze the financial reports of {company_name} for the year {year}.
- Include steps for gathering data, calculating key ratios, and summarizing findings.
- """)
- steps = task_plan.split('\n')
- results = []
- for step in steps:
- step_result = llm.generate(f"""
- Execute the following step in the financial analysis process:
- {step}
- Previous steps completed:
- {'\n'.join(results)}
- Provide the output for this step:
- """)
- results.append(step_result)
- final_report = llm.generate(f"""
- Based on the following analysis steps:
- {'\n'.join(results)}
- Generate a comprehensive financial analysis report for {company_name} for the year {year}.
- Include key insights, trends, and recommendations.
- """)
- return final_report
- # Usage
- report = financial_analysis_agent("Acme Corp", 2023)
- print(report)
Advertisement
Add Comment
Please, Sign In to add comment