AndrewVeee / nucleo-ai

An AI assistant beyond the chat box.
Apache License 2.0
313 stars 29 forks source link

TypeError: can only concatenate str (not "NoneType") to str #21

Open nullnuller opened 6 months ago

nullnuller commented 6 months ago

Research task leads to this error in the terminal and the UI hangs without any information.

n\nWrite 2 paragraphs completely covering the main topics based on what you know and use the web snippets to help with specifics.\n\nUse your expert abilities to write content, summarize what we've written, and to provide a complete, useful answer to the main topic."}]
Job Exception: timed out
Exception in thread Thread-25 (handler):
Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/user/miniconda3/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/Downloads/LLM_Applications/nucleo-ai/backend/app/ai_models/researcher_model.py", line 293, in handler
    researcher.run()
  File "/home/user/Downloads/LLM_Applications/nucleo-ai/backend/app/ai_models/researcher_model.py", line 257, in run
    content = self.result.generate_md()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Downloads/LLM_Applications/nucleo-ai/backend/app/ai_models/researcher_model.py", line 31, in generate_md
    md += self.content
TypeError: can only concatenate str (not "NoneType") to str
AndrewVeee commented 6 months ago

Hey, does a simple chat message like "hi" also hang?

A couple others have reported this problem and the primary cause usually seems to be a connection issue to the LLM in data/config.toml. There have also been some issues with instruct models with APIs like mistral or together.ai.

This might be different because it's in the document generator part of the code, but it looks like somewhere in the process, the LLM didn't return a result.

nullnuller commented 6 months ago

It now connects but not really progressing with browsing

Research Tesla's stock price for the last 5 years and relate the short-term and long-term trends at various points to events concerning the company.
Research Time Remaining: -2829 / 240
Status: Writing final content for esearch Tesla's stock price for the last 5 years and relate the short-term and long-term trends at various points to events concerning the company.
Live Preview:
 Tesla's stock price has experienced significant fluctuations over the past five years, with both short-term and long-term trends reflecting various events concerning the company. In 2017, Tesla's stock price was around $350 per share, but it saw a steady increase throughout the year, reaching an all-time high of $389 in September. This upward trend can be attributed to several factors, including the successful launch of the Model 3 and optimism surrounding Tesla's ability to meet production goals.

However, Tesla's stock price experienced a significant drop in 2018, falling to around $250 per share by the end of the year. This decline can be attributed to several factors, including concerns about Tesla's financial health and production delays for the Model 3. Despite these challenges, Tesla's stock price rebounded in 2019 and 2020, reaching an all-time high of $883 per share in January 2021. This upward trend can be attributed to several factors, including strong demand for electric vehicles, improvements in Tesla's production capabilities, and optimism surrounding the company's future growth prospects.

It is important to note that while these trends reflect various events concerning Tesla, they may also be influenced by external factors such as market conditions and investor sentiment. Additionally, it is worth noting that stock prices are not always a reliable indicator of a company's financial health or long-term prospects. Nonetheless, the trends in Tesla's stock price over the past five years provide valuable insights into the company's performance and investor perceptions.

One potential source of bias in analyzing Tesla's stock price trends is the tendency to focus on short-term fluctuations rather than long-term trends. While it is true that Tesla's stock price has experienced significant volatility over the past five years, it is important to consider the broader context of the company's performance and growth prospects. For example, while Tesla's stock price declined in 2018, the company still reported strong sales growth and made progress towards its goal of becoming profitable.

Another potential source of bias is the tendency to attribute stock price movements solely to events concerning the company, without considering external factors such as market conditions and investor sentiment. For example, while Tesla's stock price increased significantly in 2020, this trend was also driven by broader market trends and optimism surrounding electric vehicles more generally.

In conclusion, analyzing Tesla's stock price trends over the past five years provides valuable insights into the company's performance and investor perceptions. While there are potential sources of bias in this analysis, it is important to consider both short-term and long-term trends, as well as external factors that may influence stock prices. By doing so, we can gain a more nuanced understanding of Tesla's financial health and growth prospects.
Replay

Research Tesla's stock price for the last 5 years and relate the short-term and long-term trends at various points to events concerning the company.
I couldn't find a tool to perform this task: Research Tesla's stock price for the last 5 years.

I couldn't find a tool to perform this task: Identify short-term trends in Tesla's stock price over the last 5 years.

I couldn't find a tool to perform this task: Identify long-term trends in Tesla's stock price over the last 5 years.

I couldn't find a tool to perform this task: Relate short-term trends to events concerning the company.

I couldn't find a tool to perform this task: Relate long-term trends to events concerning the company.

I couldn't find a tool to perform this task: Compile findings into a coherent report.

Hey there! I tried my best to help you out with your request about Tesla's stock price trends over the last 5 years and their relation to company events. Unfortunately, I couldn't complete any of the tasks since I don't have a built-in function for stock market research or data analysis. But if you have any other questions or need help with something else, feel free to ask! 😊

State: [ "Task 6 of 6", "Task: Compile findings into a coherent report.", "Choosing function" ]
Status: [ "Research Tesla's stock price for the last 5 years.", "Identify short-term trends in Tesla's stock price over the last 5 years.", "Identify long-term trends in Tesla's stock price over the last 5 years.", "Relate short-term trends to events concerning the company.", "Relate long-term trends to events concerning the company.", "Compile findings into a coherent report." ]````

The end part of the console output (with error):
```{'role': 'user', 'content': "Doc Snippet:\n'''\n[*Not Researched*] Long-term growth of Tesla's stock price\n\n'''"}, {'role': 'user', 'content': "Doc Snippet:\n'''\nTopic: References - [*Not Researched*\nReferences\n\n[1] [Just a moment...](https://www.macrotrends.net/stocks/charts/TSLA/tesla/stock-price-history)\n\n'''"}, {'role': 'user', 'content': "Let's finish the document now.\n\nWe are writing one section of a larger document, so minimize restating the topics.\n\nIf images and links are provided above, you can include them using markdown format when they're useful.\n\nMain Topic: esearch Tesla's stock price for the last 5 years and relate the short-term and long-term trends at various points to events concerning the company.\n\nWrite 2 paragraphs completely covering the main topics based on what you know and use the web snippets to help with specifics.\n\nUse your expert abilities to write content, summarize what we've written, and to provide a complete, useful answer to the main topic."}]
[Sun Mar 10 23:57:58 2024] Request completed.
127.0.0.1 - - [10/Mar/2024 23:57:58] "POST /api//store/update HTTP/1.1" 308 -
127.0.0.1 - - [10/Mar/2024 23:57:58] "GET /icons/x.svg HTTP/1.1" 304 -
127.0.0.1 - - [10/Mar/2024 23:57:58] "GET /icons/play.svg HTTP/1.1" 200 -
127.0.0.1 - - [10/Mar/2024 23:57:59] "POST /api/store/update HTTP/1.1" 200 -
Job Exception: timed out
Exception in thread Thread-68 (handler):
Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/home/user/miniconda3/lib/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/home/user/Downloads/LLM_Applications/nucleo-ai/backend/app/ai_models/researcher_model.py", line 293, in handler
    researcher.run()
  File "/home/user/Downloads/LLM_Applications/nucleo-ai/backend/app/ai_models/researcher_model.py", line 257, in run
    content = self.result.generate_md()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Downloads/LLM_Applications/nucleo-ai/backend/app/ai_models/researcher_model.py", line 31, in generate_md
    md += self.content
TypeError: can only concatenate str (not "NoneType") to str
AndrewVeee commented 6 months ago

Hi,

First, did it really take that long to generate?! -2829 seconds would mean it spent like 50 minutes running!

What backend are you using (llama.cpp, oobabooga, ollama, etc), and which model? Do you have an estimate on tokens per second?

The web part looks like it's working, but the top search result looks like it had some anti-scraping stuff in place, based on this text: Just a moment...

There have been some discussions about adding puppeteer or a similar tool to use Chrome to browse directly, which gets around a lot of scraping sites.

nullnuller commented 6 months ago

I am using llama.cpp and miqu-70b that might take a bit of time, but I am not sure if the error is due to the time. I will try with other lighter models and see if it completes.