-
Notifications
You must be signed in to change notification settings - Fork 5.1k
added x, retuers, eodhd and more support #231
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
Open
ifitsmanu
wants to merge
1
commit into
TauricResearch:main
Choose a base branch
from
ifitsmanu:feat/support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # OpenAI Configuration | ||
| OPENAI_API_KEY=your_openai_api_key_here | ||
|
|
||
| # Anthropic Configuration | ||
| ANTHROPIC_API_KEY=your_anthropic_api_key_here | ||
|
|
||
| # X (Twitter) API Configuration | ||
| X_BEARER_TOKEN=your_x_bearer_token_here | ||
| X_API_KEY=your_x_api_key_here | ||
| X_API_SECRET=your_x_api_secret_here | ||
| X_ACCESS_TOKEN=your_x_access_token_here | ||
| X_ACCESS_SECRET=your_x_access_secret_here | ||
|
|
||
| # Bloomberg API Configuration | ||
| BLOOMBERG_API_KEY=your_bloomberg_api_key_here | ||
|
|
||
| # Reuters API Configuration | ||
| REUTERS_API_KEY=your_reuters_api_key_here | ||
|
|
||
| # Reddit Configuration | ||
| REDDIT_CLIENT_ID=your_reddit_client_id_here | ||
| REDDIT_CLIENT_SECRET=your_reddit_client_secret_here | ||
| REDDIT_USER_AGENT=TradingAgents/1.0 | ||
|
|
||
| # FinnHub Configuration | ||
| FINNHUB_API_KEY=your_finnhub_api_key_here | ||
|
|
||
| # Alpha Vantage Configuration | ||
| ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key_here | ||
|
|
||
| # Polygon.io Configuration | ||
| POLYGON_API_KEY=your_polygon_api_key_here | ||
|
|
||
| # ChromaDB Configuration | ||
| CHROMA_DB_PATH=./chroma_data | ||
|
|
||
| # Trading Configuration | ||
| TRADINGAGENTS_RESULTS_DIR=./results |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,34 @@ | ||
| typing-extensions | ||
| langchain-openai | ||
| langchain-experimental | ||
| pandas | ||
| yfinance | ||
| praw | ||
| feedparser | ||
| stockstats | ||
| eodhd | ||
| langgraph | ||
| chromadb | ||
| setuptools | ||
| backtrader | ||
| akshare | ||
| tushare | ||
| finnhub-python | ||
| parsel | ||
| requests | ||
| tqdm | ||
| pytz | ||
| redis | ||
| chainlit | ||
| rich | ||
| questionary | ||
| langchain_anthropic | ||
| langchain-google-genai | ||
| # Essential dependencies with compatible versions | ||
| pandas>=2.0.0 | ||
| numpy>=1.24.0 | ||
| requests>=2.28.0 | ||
|
|
||
| # LangChain ecosystem - compatible versions | ||
| langchain-core>=0.3.75 | ||
| langchain-openai>=0.3.0 | ||
| langchain-experimental>=0.3.0 | ||
| langchain_anthropic>=0.3.0 | ||
| langgraph>=0.6.0 | ||
| langgraph-checkpoint>=2.1.0 | ||
|
|
||
| # Financial data - minimal set | ||
| yfinance>=0.2.28 | ||
| stockstats>=0.6.2 | ||
| finnhub-python>=2.4.20 | ||
|
|
||
| # Data storage | ||
| chromadb>=0.5.0 | ||
|
|
||
| # Web scraping - essential only | ||
| feedparser>=6.0.11 | ||
| python-dotenv>=1.0.1 | ||
|
|
||
| # Text processing | ||
| textblob>=0.18.0 | ||
|
|
||
| # Utilities | ||
| tqdm>=4.66.0 | ||
| setuptools>=70.0.0 | ||
|
|
||
| # UI | ||
| rich>=13.7.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,31 @@ | ||
| from langchain_core.messages import AIMessage | ||
| import time | ||
| import json | ||
| import functools | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
|
|
||
| def create_bear_researcher(llm, memory): | ||
| def bear_node(state) -> dict: | ||
| investment_debate_state = state["investment_debate_state"] | ||
| if not state or not isinstance(state, dict): | ||
| raise ValueError("Invalid state provided to bear_researcher") | ||
|
|
||
| investment_debate_state = state.get("investment_debate_state", {}) | ||
| history = investment_debate_state.get("history", "") | ||
| bear_history = investment_debate_state.get("bear_history", "") | ||
|
|
||
| current_response = investment_debate_state.get("current_response", "") | ||
| market_research_report = state["market_report"] | ||
| sentiment_report = state["sentiment_report"] | ||
| news_report = state["news_report"] | ||
| fundamentals_report = state["fundamentals_report"] | ||
| market_research_report = state.get("market_report", "") | ||
| sentiment_report = state.get("sentiment_report", "") | ||
| news_report = state.get("news_report", "") | ||
| fundamentals_report = state.get("fundamentals_report", "") | ||
|
|
||
| curr_situation = f"{market_research_report}\n\n{sentiment_report}\n\n{news_report}\n\n{fundamentals_report}" | ||
| past_memories = memory.get_memories(curr_situation, n_matches=2) | ||
| curr_situation = f"Market: {market_research_report}\nSentiment: {sentiment_report}\nNews: {news_report}\nFundamentals: {fundamentals_report}" | ||
| past_memories = memory.get_memories(curr_situation, n_matches=3, min_similarity=0.8) | ||
|
|
||
| past_memory_str = "" | ||
| for i, rec in enumerate(past_memories, 1): | ||
| past_memory_str += rec["recommendation"] + "\n\n" | ||
| if past_memories: | ||
| for i, rec in enumerate(past_memories, 1): | ||
| similarity = rec.get("similarity_score", 0) | ||
| past_memory_str += f"Bear Memory {i} (similarity: {similarity:.3f}): {rec['recommendation']}\n\n" | ||
| else: | ||
| past_memory_str = "No statistically significant bear memories found (similarity < 80%)." | ||
|
|
||
| prompt = f"""You are a Bear Analyst making the case against investing in the stock. Your goal is to present a well-reasoned argument emphasizing risks, challenges, and negative indicators. Leverage the provided research and data to highlight potential downsides and counter bullish arguments effectively. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,31 @@ | ||
| from langchain_core.messages import AIMessage | ||
| import time | ||
| import json | ||
| import functools | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
|
|
||
| def create_bull_researcher(llm, memory): | ||
| def bull_node(state) -> dict: | ||
| investment_debate_state = state["investment_debate_state"] | ||
| if not state or not isinstance(state, dict): | ||
| raise ValueError("Invalid state provided to bull_researcher") | ||
|
|
||
| investment_debate_state = state.get("investment_debate_state", {}) | ||
| history = investment_debate_state.get("history", "") | ||
| bull_history = investment_debate_state.get("bull_history", "") | ||
|
|
||
| current_response = investment_debate_state.get("current_response", "") | ||
| market_research_report = state["market_report"] | ||
| sentiment_report = state["sentiment_report"] | ||
| news_report = state["news_report"] | ||
| fundamentals_report = state["fundamentals_report"] | ||
| market_research_report = state.get("market_report", "") | ||
| sentiment_report = state.get("sentiment_report", "") | ||
| news_report = state.get("news_report", "") | ||
| fundamentals_report = state.get("fundamentals_report", "") | ||
|
|
||
| curr_situation = f"{market_research_report}\n\n{sentiment_report}\n\n{news_report}\n\n{fundamentals_report}" | ||
| past_memories = memory.get_memories(curr_situation, n_matches=2) | ||
| curr_situation = f"Market: {market_research_report}\nSentiment: {sentiment_report}\nNews: {news_report}\nFundamentals: {fundamentals_report}" | ||
| past_memories = memory.get_memories(curr_situation, n_matches=3, min_similarity=0.8) | ||
|
|
||
| past_memory_str = "" | ||
| for i, rec in enumerate(past_memories, 1): | ||
| past_memory_str += rec["recommendation"] + "\n\n" | ||
| if past_memories: | ||
| for i, rec in enumerate(past_memories, 1): | ||
| similarity = rec.get("similarity_score", 0) | ||
| past_memory_str += f"Bull Memory {i} (similarity: {similarity:.3f}): {rec['recommendation']}\n\n" | ||
| else: | ||
| past_memory_str = "No statistically significant bull memories found (similarity < 80%)." | ||
|
|
||
| prompt = f"""You are a Bull Analyst advocating for investing in the stock. Your task is to build a strong, evidence-based case emphasizing growth potential, competitive advantages, and positive market indicators. Leverage the provided research and data to address concerns and counter bearish arguments effectively. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This file is missing critical dependencies required for the application to function correctly. The
prawlibrary, which is necessary for Reddit integration, has been removed. Additionally,reuterspyis used as a fallback intradingagents/dataflows/reuters_utils.pybut is not listed as a dependency. These omissions will lead toImportErrorexceptions at runtime.Please add the missing dependencies to this file. For example: