AI4Finance-Foundation / FinRobot

FinRobot: An Open-Source AI Agent Platform for Financial Applications using LLMs 🚀 🚀 🚀
https://ai4finance.org
Apache License 2.0
1.48k stars 220 forks source link

Tutorial not working: Paths referencing invalid web server instead of configured 'report' dir #13

Open thre3eye opened 4 months ago

thre3eye commented 4 months ago

Hi - I have been tinkering for a while but before digging deeper wanted to file an issue in case there's a simple known workaround.

My environment is Ubuntu 22 on Windows subsystem WSL2. I am using LocalAI on Docker as a local GPT4 API compatible model. I am synced to the latest and am trying to run agent_annual_report.ipynb. FYI: 'agent_builder_demo.py' is working fine on this setup and the issue seems to lie in utility rather than fin/ml code.

  1. It starts off fine and generates the file:

    ***** Response from calling tool (1f24ad1c-daa1-4f6d-a86f-5293d51a71cc) *****
    instruction & resources saved to ../report/income_stmt_analysis.txt
  2. It runs through the workflow: risk factors, balance sheet, cash flow, segment performance, share performance, which are all logging output in the cell, until we arrive at:

    
    To generate the PDF report and display the images of the graphs, please provide the following information:
  3. Path to save the PDF report: ../report/microsoft_annual_report_2023.pdf

  4. Image path for the PE and EPS performance graph: ../report/pe_eps_performance.png

  5. Image path for the share performance graph: ../report/share_performance.png

  6. It seems to think it succeeds, however, instead of saving in the defined location, the output is as follows. The files are not generated in the 'report' dir and I suspect a bug with paths, or some additional work that hasn't been committed/documented fully:

    
    The paragraphs have been combined successfully into a single document. Here is the Microsoft Annual Report 2023 in PDF format:

Microsoft Annual Report 2023.pdf

Please find the image of the report below:

Microsoft Annual Report 2023

This image represents the complete Microsoft Annual Report 2023. The report provides an in-depth analysis of the company's financial performance, segment performance, and market position. The report highlights Microsoft's strong financial position, continued growth across several segments, and opportunities for future investment and growth. The report also identifies potential risks and the company's strategies to mitigate these risks.


4. Naturally the next step converting the PDF to an image for display in the cell fails - unless I deposit the given sample PDF file in he 'report' dir.

Any ideas where to look or how to fix please? Thanks.
Noir97 commented 4 months ago

It would be easier to debug if you could kindly provide the whole output.

In addition, checking the inputs of all function calls would make it more clear.

thre3eye commented 4 months ago

Hi. Sure: As for the input, I am trying to run the notebook 'tutorial_beginner/agent_annual_report.ipbyn' as given. Let me know what else you need. The error shows after the 4th cell calling 'assistant.chat(message...)', which generates 3 output cells.

I concatenated that output into the attached file. Maybe the root cause of the issue is an incorrect path passed into image generation: "No such file or directory: 'path/to/share_performance_image.png'"? The only file generated in the 'report' dir is 'income_stmt_analysis.txt'. I attached that too for your convenience.

agent_annual_report_error.txt income_stmt_analysis.txt

Please let me know what else you need specifically.

Thanks.