Closed iamsaurabhc closed 8 months ago
🤖
Hello @iamsaurabhc,
I'm Dosu, a bot created to assist you with solving bugs, answering questions, and helping you become a contributor to the LlamaIndex repository. While we wait for a human maintainer, I'm here to provide initial support. Nice to meet you!
Based on the information provided, it seems that the LlamaIndex codebase does include references to OpenAIAgent, but I couldn't find any specific references to the version 0.9.10 or the function "GetStockHistoryWithIndicators" within the LlamaIndex repository. It's possible that these are part of the OpenAIAgent codebase, or they could be custom additions in your local environment.
Regarding the error you're encountering on the second run of your command, it's difficult to provide a precise solution without the specific error message. However, the LlamaIndex codebase does include a logging mechanism that could help you diagnose the issue. You can configure this logger to output messages to the console or to a file, which might give you more information about the error.
Here's an example of how you can configure the logger:
import logging
logger = logging.getLogger('llama_index')
logger.setLevel(logging.DEBUG) # or whatever level you want
handler = logging.StreamHandler() # or FileHandler('llama_index.log')
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
This will output log messages with a timestamp, the logger name, the level of the message, and the message itself. You can find more information about this in the llama_index/init.py file.
If you're still encountering the issue after trying this, could you please provide more details about the error message you're seeing, or any other relevant information? This will help me assist you better.
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Hi @iamsaurabhc,
It seems your request is being treated as a bad request from OpenAI API and hence there is an error. Also, would it be possible to share the stock_df
and add_all_ta_features
functions to replicate the error?
Hi, @iamsaurabhc,
I'm helping the LlamaIndex team manage their backlog and am marking this issue as stale. It looks like you're experiencing a bug with the OpenAIAgent in your tool, where the first run is successful but the second run throws a BadRequestError with the message "[] is too short - 'messages'". The initial support provided by the bot Dosu suggested the use of the logging mechanism in the LlamaIndex codebase to diagnose the issue, and user ravi03071991 requested the sharing of specific functions to replicate the error.
Could you please confirm if this issue is still relevant to the latest version of the LlamaIndex repository? If it is, please let the LlamaIndex team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days. Thank you!
Bug Description
Trying to use a custom function in the tool using OpenAIAgent
The first run is successful and the function output is visible. For the second run, I'm getting an error.
Attached relevant file for you guys. Any help would be appreciated!
Also, great work building this library!
Version
0.9.10
Steps to Reproduce
python agent.py
Relevant Logs/Tracbacks