Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

NOT WORKING - [AI Crew for Stock Analysis]. Getting Errors #225

Open
appydam opened this issue Feb 7, 2025 · 1 comment
Open

NOT WORKING - [AI Crew for Stock Analysis]. Getting Errors #225

appydam opened this issue Feb 7, 2025 · 1 comment

Comments

@appydam
Copy link

appydam commented Feb 7, 2025

Getting error on running - https://github.com/crewAIInc/crewAI-examples/tree/main/stock_analysis
After this command - poetry run python3 main.py
I'm running deepseek with ollama instead of using gpt4o

`/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/langchain/llms/init.py:549: LangChainDeprecationWarning: Importing LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.llms import Ollama.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
/Users/arpit.dhamija1/Downloads/crewAI-examples-main/stock_analysis/src/stock_analysis/crew.py:14: LangChainDeprecationWarning: The class Ollama was deprecated in LangChain 0.3.1 and will be removed in 1.0.0. An updated version of the class exists in the :class:~langchain-ollama package and should be used instead. To use it run pip install -U :class:~langchain-ollama and import as from :class:~langchain_ollama import OllamaLLM``.
llm = Ollama(model="deepseek-r1:1.5b")

Welcome to Stock Analysis Crew


Traceback (most recent call last):
File "/Users/arpit.dhamija1/Downloads/crewAI-examples-main/stock_analysis/src/stock_analysis/main.py", line 28, in
result = run()
^^^^^
File "/Users/arpit.dhamija1/Downloads/crewAI-examples-main/stock_analysis/src/stock_analysis/main.py", line 9, in run
return StockAnalysisCrew().crew().kickoff(inputs=inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai/project/utils.py", line 7, in memoized_func
cache[key] = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai/project/annotations.py", line 95, in wrapper
task_instance = task_method(self)
^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai/project/utils.py", line 7, in memoized_func
cache[key] = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai/project/annotations.py", line 23, in wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Downloads/crewAI-examples-main/stock_analysis/src/stock_analysis/crew.py", line 84, in financial_analysis
agent=self.financial_analyst_agent(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai/project/utils.py", line 7, in memoized_func
cache[key] = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Downloads/crewAI-examples-main/stock_analysis/src/stock_analysis/crew.py", line 73, in financial_analyst_agent
WebsiteSearchTool(),
^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai_tools/tools/website_search/website_search_tool.py", line 34, in init
super().init(**kwargs)
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/pydantic/main.py", line 214, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/crewai_tools/tools/rag/rag_tool.py", line 47, in _set_default_adapter
app = App.from_config(config=self.config) if self.config else App()
^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/embedchain/app.py", line 121, in init
self.embedding_model = embedding_model or OpenAIEmbedder()
^^^^^^^^^^^^^^^^
File "/Users/arpit.dhamija1/Library/Caches/pypoetry/virtualenvs/stock-analysis-pdQbdmQP-py3.12/lib/python3.12/site-packages/embedchain/embedder/openai.py", line 18, in init
api_key = self.config.api_key or os.environ["OPENAI_API_KEY"]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "", line 714, in getitem
KeyError: 'OPENAI_API_KEY'`

@adityaJoshi-coreco
Copy link

Hey ,
1.First error i can see is that you need to set up your OPENAI_API_KEY in your environment
or
Or create a .env file in your project directory and then set it up

  1. If you want to avoid using OpenAI completely, you'll need to configure the WebsiteSearchTool to use a different embedding model.

this is all i could think of after reading through error logs , might be wrong but worth the shot ig .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants