Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unhandled Exceptions for Different Tickers #95

Open
YazeedMusallam opened this issue Feb 13, 2025 · 2 comments
Open

Unhandled Exceptions for Different Tickers #95

YazeedMusallam opened this issue Feb 13, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@YazeedMusallam
Copy link

Describe the Bug

Hi everyone,

First off, thank you all for the effort you’ve put into this project! I really appreciate the work being done.

I’ve come across a few cases where exceptions aren’t properly handled, leading to crashes (or consuming financialdatasets.ai api). One example is when running the AI Hedge Fund script with the following setup:

poetry run python src/main.py --ticker RDDT

After selecting analysts and the LLM model, everything runs fine until the Valuation Analyst step, where the script crashes with this error:

Traceback (most recent call last):
  File "src/main.py", line 278, in <module>
    result = run_hedge_fund(
  File "src/main.py", line 67, in run_hedge_fund
    final_state = agent.invoke(
  ...
  File "src/agents/valuation.py", line 212, in calculate_intrinsic_value
    cash_flows = [free_cash_flow * (1 + growth_rate) ** i for i in range(num_years)]
  File "src/agents/valuation.py", line 212, in <listcomp>
    cash_flows = [free_cash_flow * (1 + growth_rate) ** i for i in range(num_years)]
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

Note: I've also encountered other exceptions when choosing different tickers.

Let me know if I can provide more details. Thanks again for the great work! 🚀
Thanks,

@YazeedMusallam YazeedMusallam added the bug Something isn't working label Feb 13, 2025
@thpreihs
Copy link

Seems like a lack of exception handling when retrieving data from the financialdatasets.ai. Have you run a manual call to their API with the ticker / date you need? Perhaps for this specific call there is a NULL value on the Free Cash Flow attribute.

@prxshetty
Copy link

@YazeedMusallam you need to add credits in the api for the custom tickers to work in this. the only free ones are as he has listed in the github readme:

Financial data for AAPL, GOOGL, MSFT, NVDA, and TSLA is free and does not require an API key.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants