feat: multi-provider support, retry logic, and dynamic model fetching#324
feat: multi-provider support, retry logic, and dynamic model fetching#324MUmarJ wants to merge 7 commits intoTauricResearch:mainfrom
Conversation
Handle Gemini's list-of-dicts response format alongside OpenAI/Anthropic strings
Retry connection/timeout errors with backoff, skip retry for rate limits
Add ChatOpenAIResponses wrapper, dynamic web_search tool selection, robust response parsing
Warn when using local LLM with OpenAI-only data vendors, suggest alternatives
Fetch latest models from provider APIs, add LM Studio support, improve provider selection UX
Summary of ChangesHello @MUmarJ, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the system's flexibility and resilience by expanding support for multiple Large Language Model (LLM) providers, including dynamic model fetching and robust error handling. It refines the user experience through an enhanced command-line interface that intelligently guides model selection and provides clear feedback on provider availability, ensuring smoother operations and broader compatibility with cutting-edge LLMs. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Tested thoroughly with the following params:
These are updates I made for my own testing to get better results with new models + lower cost web_search api while mainting backcompat when FETCH_LATEST .env is set to false - which allows you to use old GPT 4o models with web_search_preview tool and old API v1/chat versus the new /v1/response API for gpt-5 onwards |
There was a problem hiding this comment.
Code Review
This is a substantial pull request that introduces significant enhancements, including multi-provider support, dynamic model fetching, and robust error handling with retry logic. The addition of a wrapper for OpenAI's Responses API is a great forward-looking feature. The code is generally well-structured and the CLI improvements provide a much better user experience. I've identified a few areas for improvement, including more specific exception handling, refactoring duplicated code, and a potential issue in the new ChatOpenAIResponses wrapper that could affect tool usage. Overall, this is a very strong contribution.
Move RateLimitError to break block, use specific exceptions, remove duplicate entry
Adds --date arg to filter reports by date and auto-generate filename with date and symbols
798d030 to
b950e3a
Compare
Summary
This PR adds several improvements to enhance multi-LLM provider support, error handling, and CLI usability.
Changes
1. Content Normalization for Multi-Provider Support
normalize_content()utility to handle Gemini's list-of-dicts response format alongside OpenAI/Anthropic strings2. Retry Logic with Exponential Backoff
3. OpenAI Responses API Support (GPT-5 Ready)
tradingagents/llm/module with LangChain-compatible Responses API wrappergpt-5*,codex*)web_searchtool type selection based onFETCH_LATESTenv var4. Configuration Validation for Local LLM Providers
validate_config()that warns when using local LLM with OpenAI-only data vendors5. Dynamic Model Fetching & CLI Enhancements
FETCH_LATEST=trueIssues Addressed