Add support for OpenAI, Cohere, and improve Ollama integration#1
Open
maddygoround wants to merge 1 commit intomainfrom
Open
Add support for OpenAI, Cohere, and improve Ollama integration#1maddygoround wants to merge 1 commit intomainfrom
maddygoround wants to merge 1 commit intomainfrom
Conversation
This change extends DeepReview to support multiple Large Language Model providers, including local Ollama instances, OpenAI API, and Cohere API. Key changes: - Modified `config.yaml` structure to support provider-specific configurations (Ollama, OpenAI, Cohere, and a generic API placeholder). - Added `llm_provider` setting to select the active LLM provider. - Updated `BranchDiffAnalyzer` to load new configurations and initialize the appropriate LLM client (Ollama, ChatOpenAI, Cohere) via a unified `get_llm(model_type)` method. - API keys for OpenAI and Cohere can be sourced from config or environment variables (OPENAI_API_KEY, COHERE_API_KEY). - `analyze_file` method now routes requests to the correct LLM provider, using chat-style interaction for OpenAI and LLMChain for Ollama/Cohere. - `interactive_qa` updated to use the configured QA model from the chosen provider, adapting interaction style (chat vs. LLMChain). - Command-line arguments enhanced to allow overriding config settings for LLM provider, models, main branch, output options, etc. - Improved error handling and logging for API calls, configuration loading, and git operations. - Updated `README.md` to document new features, command-line arguments, and detailed configuration for each provider. - Added `langchain-community`, `langchain-openai`, and `langchain-cohere` to `setup.py` dependencies. - Initial unit tests were added but encountered environment issues; these can be revisited.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change extends DeepReview to support multiple Large Language Model providers, including local Ollama instances, OpenAI API, and Cohere API.
Key changes:
config.yamlstructure to support provider-specific configurations (Ollama, OpenAI, Cohere, and a generic API placeholder).llm_providersetting to select the active LLM provider.BranchDiffAnalyzerto load new configurations and initialize the appropriate LLM client (Ollama, ChatOpenAI, Cohere) via a unifiedget_llm(model_type)method.analyze_filemethod now routes requests to the correct LLM provider, using chat-style interaction for OpenAI and LLMChain for Ollama/Cohere.interactive_qaupdated to use the configured QA model from the chosen provider, adapting interaction style (chat vs. LLMChain).README.mdto document new features, command-line arguments, and detailed configuration for each provider.langchain-community,langchain-openai, andlangchain-coheretosetup.pydependencies.