-
Notifications
You must be signed in to change notification settings - Fork 736
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
feat: Integrate OpenBB Into Camel #1300
Conversation
0e3d6b4
to
8e1a24c
Compare
camel/toolkits/openbb_toolkit.py
Outdated
|
||
return base_symbol | ||
|
||
def get_company_fundamentals( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The openBB supports so many functionalities(https://docs.openbb.co/platform/reference). Only for the fundamentals, it supports lots of options(https://docs.openbb.co/platform/reference/equity/fundamental). Couple general questions:
- How did we decide which functionalities to integrate first?
- Could we do something like
func = self.client.equity.fundamentals.get(statement) func(symbol=symbol, provider=provider)
? So that we don't need to list all the options which are too many. We only need to check if it exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow thanks @willshang76 for your comment, I will think about how to integrate these ideas into the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @anjieyang , left some comments below
pyproject.toml
Outdated
types-redis = "^4.6.0.20240106" | ||
types-requests = "^2.31.0.20240106" | ||
types-python-dateutil = "^2.8.19.20240106" | ||
types-pytz = "^2024.1.0.20240104" | ||
types-PyYAML = "^6.0.12.12" | ||
types-beautifulsoup4 = "^4.12.0.20240106" | ||
types-colorama = "^0.4.15.20240106" | ||
types-docutils = "^0.20.0.20240106" | ||
types-jsonschema = "^4.21.0.20240106" | ||
types-pillow = "^10.2.0.20240106" | ||
types-protobuf = "^4.24.0.20240106" | ||
types-setuptools = "^69.0.0.20240106" | ||
types-six = "^1.16.21.20240106" | ||
types-urllib3 = "^1.26.25.14" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need to add this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this last time because I cannot pass the pre-commit check😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @anjieyang , some test failed, could you help checking and fixing this, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @anjieyang. I've made some updates to the code:
First, we need to prioritize ensuring the code works as intended. Regarding the implementation of DataFrame conversion, I noticed that different data providers may return varying types of information. The DataFrame schema you defined doesn't cover all possible cases. Since the DataFrame is intended for human users, developers can handle the conversion themselves. Maintaining a comprehensive schema for all providers would be challenging, so I removed the DataFrame output part.
The code quality could be improved in a few areas. There are instances where duplicate methods from the OpenBB client are used, which can be optimized to reduce redundancy. Additionally, some methods include a provider argument that isn't valid. It's important to verify all code thoroughly
Since the docstrings will be passed to the agent, I streamlined the content to avoid exceeding token limits. In the initial implementation, it was easy to hit token limits when running the agent with this tool for multiple rounds.
Make sure only necessary dependencies added and the added dependencies are in the right place, there were some unnecessary dependencies added and not categoried correctly.
Please review the changes and let me know if there's anything you'd like to discuss. Thanks again for your contribution, and Happy New Year!
Description
Integrate OpenBB Platform with CAMEL by adding OpenBBToolkit class for financial data access and analysis. This includes stock quotes, market screening, economic indicators functionality, and ChatAgent integration for interactive analysis.
Motivation and Context
CAMEL needs financial data analysis capabilities to enable AI agents to process and analyze market data. The OpenBB Platform provides comprehensive financial data APIs that can be leveraged through a toolkit interface.
Types of changes
Implemented Tasks
camel/toolkits/openbb_toolkit.py
examples/toolkits/openbb_toolkit.py
test/toolkits/test_openbb_functions.py
Checklist