Commit Graph

28 Commits

Author SHA1 Message Date
google-labs-jules[bot] 72d352d401 feat: Partial migration from OpenAI to Gemini
This commit includes the following changes as part of an ongoing effort to migrate the project from OpenAI models and SDKs to Google's Gemini:

1.  **Updated `requirements.txt`**:
    *   Removed `langchain-openai` and `openai`.
    *   Added `langchain-google-genai` and `google-generativeai`.

2.  **Modified `tradingagents/agents/utils/agent_utils.py`**:
    *   Replaced the import of `ChatOpenAI` from `langchain_openai` with `ChatGoogleGenerativeAI` from `langchain_google_genai`.
    *   Updated tool function names (e.g., `get_stock_news_openai` to `get_stock_news_gemini`) and their internal calls to `interface` methods to reflect changes in `interface.py`.

3.  **Refactored `tradingagents/dataflows/interface.py`**:
    *   Removed direct usage of the `openai` package.
    *   Added `google.generativeai` for direct Gemini API calls.
    *   Configured Gemini API key handling via the `GEMINI_API_KEY` environment variable.
    *   Rewrote `get_stock_news_openai`, `get_global_news_openai`, and `get_fundamentals_openai` to use `gemini-pro` via `genai.GenerativeModel`. These functions were renamed to `_gemini` equivalents (e.g., `get_stock_news_gemini`).
    *   Removed the `web_search_preview` function as it's not directly available in the `google-generativeai` SDK in the same way.

**Work In Progress / Next Steps:**

The migration is not yet complete. Your feedback indicated that many files still contain the "openai" keyword, which would need to be addressed. Key remaining tasks before this migration can be considered complete include:

*   **Locating and updating main Langchain LLM instantiations**: The `ChatOpenAI` models (e.g., `quick_thinking_llm`, `deep_thinking_llm` passed to `GraphSetup`) are instantiated outside of the files modified so far. These instantiations need to be found (likely in `main.py` or `cli/main.py`) and changed to `ChatGoogleGenerativeAI`.
*   **Updating all type hints**: Type hints for `ChatOpenAI` need to be changed to `ChatGoogleGenerativeAI` in `tradingagents/graph/setup.py` and throughout all agent creation functions and their usages in `tradingagents/agents/`.
*   **Addressing all remaining "openai" keywords**: A global search for "openai" should be performed to identify and address any remaining occurrences in comments, documentation, or other utility functions throughout the project.
*   **Thorough testing**: Once all code changes are made, comprehensive testing (unit, integration, manual) will be required.

I was in the process of identifying the central LLM instantiation points when the work was submitted.
2025-06-17 03:34:07 +00:00
saksham0161 570644d939
Fix ticker hardcoding in prompt (#28) 2025-06-11 19:43:39 -07:00
neo a879868396
docs: add links to other language versions of README (#13)
Added language selection links to the README for easier access to translated versions: German, Spanish, French, Japanese, Korean, Portuguese, Russian, and Chinese.
2025-06-09 15:51:06 -07:00
Yijia-Xiao 0013415378 Add star history 2025-06-09 15:14:41 -07:00
Edward Sun 0fdfd35867
Fix default python usage config code 2025-06-08 13:16:10 -07:00
Edward Sun e994e56c23
Remove EODHD from readme 2025-06-07 15:04:43 -07:00
Yijia-Xiao 47176ba8a2 chore(release): v0.1.1 – TradingAgents cleaned release 2025-06-07 12:17:58 -07:00
Edward Sun 5f1c9c43cf removed static site 2025-06-05 11:14:05 -07:00
Yijia-Xiao cc97cb6d5d chore(release): v0.1.0 – initial public release of TradingAgents 2025-06-05 04:27:57 -07:00
Yijia-Xiao 635e91ac75 Schema upload 2025-02-02 12:53:37 -08:00
Yijia-Xiao af6f916ffd Reference 2025-01-23 17:17:32 -08:00
Yijia-Xiao 1f55a4d229 Update index.html 2025-01-20 22:13:50 -08:00
Yijia-Xiao 6945ab30cf Update index.html 2025-01-20 22:09:22 -08:00
Yijia-Xiao ee0502bf86 Update index.html 2025-01-20 21:36:27 -08:00
Yijia Xiao 5986f61283 Update index.html 2025-01-20 21:25:41 -08:00
Yijia Xiao 1a2074b60e Update README.md 2025-01-20 21:21:43 -08:00
Yijia-Xiao 413d9ecbcf Paper and Code links 2024-12-31 11:58:35 +08:00
Yijia-Xiao c252bbb155 Brief 2024-12-29 15:04:43 +08:00
Yijia-Xiao c850ddf1a7 Brief version 2024-12-29 15:00:27 +08:00
Yijia-Xiao 0ef7b46579 Results 2024-12-28 13:41:45 +08:00
Yijia-Xiao 21890ac942 Results 2024-12-28 13:35:10 +08:00
Yijia-Xiao 1920757ed9 Layout 2024-12-28 13:06:03 +08:00
Yijia-Xiao fac7eca73f Layout 2024-12-28 12:51:51 +08:00
Yijia-Xiao 2e8a02e874 Layout 2024-12-28 12:35:29 +08:00
Yijia-Xiao 8b7b5b9c78 Layout 2024-12-28 12:28:02 +08:00
Yijia-Xiao db9f63fa54 Citations 2024-12-28 11:56:38 +08:00
Yijia-Xiao a70ca6e1a1 Figures 2024-12-28 11:47:36 +08:00
Yijia-Xiao c2fa046a9b TradingAgents-AI 2024-12-28 11:32:06 +08:00